Skip to content

Commit

Permalink
support for combination with default-values-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
StiftungAusNachlass committed Aug 29, 2023
1 parent d250e5f commit 1d7d653
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/webfrontend/EditorFieldVisibility.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,8 @@ class EditorFieldVisibility extends CustomMaskSplitter
# hide field
CUI.dom.hideElement(actionField.element)

node = actionField.element

# clear value of field
if domData || actionField.isCustomType
if actionField?.dataReference
Expand All @@ -339,7 +341,7 @@ class EditorFieldVisibility extends CustomMaskSplitter
else
actionField.dataReference[actionField.dataTarget][deletionValue] = null
if actionField.dataReference[actionField.dataTarget].hasOwnProperty('conceptURI')
actionField.dataReference[actionField.dataTarget] = null
actionField.dataReference[actionField.dataTarget] = {}

##################################
# clear base-fields
Expand Down Expand Up @@ -378,11 +380,14 @@ class EditorFieldVisibility extends CustomMaskSplitter
if node.length == 0
node = actionField.element

if node.length > 0
node = node[0]

# call plugins, which use syntax from commons.coffee (customPluginEditorLayout)
if node
CUI.Events.trigger
type: 'custom-deleteDataFromPlugin'
node: node[0]
node: node
bubble: false

if (! actionField.isCustomType || domData) && actionField.type != 'text_l10n' && actionField.type != 'text_l10n_oneline'
Expand Down

0 comments on commit 1d7d653

Please sign in to comment.