Skip to content

Commit

Permalink
EZP-30032: CustomTags not saved correctly (#833)
Browse files Browse the repository at this point in the history
* Fixed Custom Tags not being saved properly

* Fixes after CR

* Fixes after CR

* CS fix (no new line...)
  • Loading branch information
mateuszbieniek authored and Łukasz Serwatka committed Feb 12, 2019
1 parent dee4fd7 commit c9f3de8
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 3 deletions.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
selector: '[data-ezelement="ezcontent"]',
},
},
setNameFireEditorInteractionTimeout: null,
setAlignmentFireEditorInteractionTimeout: null,
unsetAlignmentFireEditorInteractionTimeout: null,
setConfigFireEditorInteractionTimeout: null,
clearConfigFireEditorInteractionTimeout: null,

upcast: (element) => {
return (
Expand Down Expand Up @@ -210,6 +215,8 @@
*/
setName: function(name) {
this.element.data('ezname', name);
window.clearTimeout(this.setNameFireEditorInteractionTimeout);
this.setNameFireEditorInteractionTimeout = window.setTimeout(this.fireEditorInteraction.bind(this, 'nameUpdated'), 50);

return this;
},
Expand Down Expand Up @@ -263,6 +270,11 @@
setAlignment: function(type) {
this.wrapper.data(DATA_ALIGNMENT_ATTR, type);
this.element.data(DATA_ALIGNMENT_ATTR, type);
window.clearTimeout(this.setAlignmentFireEditorInteractionTimeout);
this.setAlignmentFireEditorInteractionTimeout = window.setTimeout(
this.fireEditorInteraction.bind(this, 'aligmentUpdated'),
50
);
},

/**
Expand All @@ -274,6 +286,11 @@
unsetAlignment: function() {
this.wrapper.data(DATA_ALIGNMENT_ATTR, false);
this.element.data(DATA_ALIGNMENT_ATTR, false);
window.clearTimeout(this.unsetAlignmentFireEditorInteractionTimeout);
this.unsetAlignmentFireEditorInteractionTimeout = window.setTimeout(
this.fireEditorInteraction.bind(this, 'aligmentRemoved'),
50
);
},

/**
Expand Down Expand Up @@ -333,6 +350,11 @@
}

valueElement.setText(value);
window.clearTimeout(this.setConfigFireEditorInteractionTimeout);
this.setConfigFireEditorInteractionTimeout = window.setTimeout(
this.fireEditorInteraction.bind(this, 'configUpdated'),
50
);

return this;
},
Expand Down Expand Up @@ -383,6 +405,12 @@
while (config.firstChild) {
config.removeChild(config.firstChild);
}

window.clearTimeout(this.clearConfigFireEditorInteractionTimeout);
this.clearConfigFireEditorInteractionTimeout = window.setTimeout(
this.fireEditorInteraction.bind(this, 'configCleared'),
50
);
},

/**
Expand Down

0 comments on commit c9f3de8

Please sign in to comment.