Hide settings when deleting, duplicating or dragging block
[MAILPOET-1974]
This commit is contained in:
@@ -66,6 +66,7 @@ Module.BlockView = AugmentedView.extend({
|
|||||||
onDrop: function onDrop(options) {
|
onDrop: function onDrop(options) {
|
||||||
// After a clone of model has been dropped, cleanup
|
// After a clone of model has been dropped, cleanup
|
||||||
// and destroy self
|
// and destroy self
|
||||||
|
App.getChannel().trigger('hideSettings');
|
||||||
options.dragBehavior.view.model.destroy();
|
options.dragBehavior.view.model.destroy();
|
||||||
},
|
},
|
||||||
onDragSubstituteBy: function onDragSubstituteBy(behavior) {
|
onDragSubstituteBy: function onDragSubstituteBy(behavior) {
|
||||||
@@ -247,11 +248,13 @@ Module.BlockToolsView = AugmentedView.extend({
|
|||||||
deleteBlock: function deleteBlock(event) {
|
deleteBlock: function deleteBlock(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
this.model.trigger('delete');
|
this.model.trigger('delete');
|
||||||
|
App.getChannel().trigger('hideSettings');
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
duplicateBlock: function duplicateBlock(event) {
|
duplicateBlock: function duplicateBlock(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
this.model.trigger('duplicate');
|
this.model.trigger('duplicate');
|
||||||
|
App.getChannel().trigger('hideSettings');
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -280,6 +283,7 @@ Module.BlockSettingsView = Marionette.View.extend({
|
|||||||
} else {
|
} else {
|
||||||
MailPoet.Modal.panel(panelParams);
|
MailPoet.Modal.panel(panelParams);
|
||||||
}
|
}
|
||||||
|
this.listenTo(App.getChannel(), 'hideSettings', this.close);
|
||||||
},
|
},
|
||||||
templateContext: function templateContext() {
|
templateContext: function templateContext() {
|
||||||
return {
|
return {
|
||||||
|
Reference in New Issue
Block a user