Skip to content

Commit

Permalink
Add a red border to the inline move dropdown when plugin is in an unk…
Browse files Browse the repository at this point in the history
…nown region
  • Loading branch information
matthiask committed Oct 2, 2024
1 parent a546f68 commit ca03e74
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Next version
attribute; recommended values include 0 (the default), 1 (open one section)
and -1 (close one section). Those sections are collapsed and moved as one
unit during editing.
- Added a red border to the region dropdown of plugins in unknown regions.


7.0 (2024-05-31)
Expand Down
4 changes: 4 additions & 0 deletions content_editor/static/content_editor/content_editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
const prepareContentEditorObject = () => {
Object.assign(ContentEditor, JSON.parse(_contentEditorContext))
Object.assign(ContentEditor, {
declaredRegions: [...ContentEditor.regions],
pluginsByPrefix: Object.fromEntries(
ContentEditor.plugins.map((plugin) => [plugin.prefix, plugin]),
),
Expand Down Expand Up @@ -968,6 +969,9 @@
.order-machine .inline-related.for-deletion .inline_label::after {
opacity: 0.5;
content: " (${ContentEditor.messages.forDeletion})";
}
.order-machine .inline-related:not(:where(${ContentEditor.declaredRegions.map((region) => `[data-region="${region.key}"]`).join(", ")})) .inline_move_to_region {
border-color: red;
}
`
document.head.appendChild(style)
Expand Down

0 comments on commit ca03e74

Please sign in to comment.