Remember currently showed settings model ID
[MAILPOET-1974]
This commit is contained in:
@@ -21,6 +21,7 @@ var EditorApplication = Marionette.Application.extend({
|
||||
onStart: function onStart() {
|
||||
this._appView = new AppView();
|
||||
this.showView(this._appView);
|
||||
this.listenTo(this.getChannel(), 'settingsShowed', this.setShowedSettingsId);
|
||||
},
|
||||
|
||||
getChannel: function getChannel(channel) {
|
||||
@@ -29,6 +30,10 @@ var EditorApplication = Marionette.Application.extend({
|
||||
}
|
||||
return Radio.channel(channel);
|
||||
},
|
||||
|
||||
setShowedSettingsId: function setShowedSettingsId(id) {
|
||||
this.showedSettingsId = id;
|
||||
},
|
||||
});
|
||||
|
||||
var app = new EditorApplication();
|
||||
|
@@ -225,6 +225,7 @@ Module.BlockToolsView = AugmentedView.extend({
|
||||
},
|
||||
changeSettings: function changeSettings(options) {
|
||||
var ViewType = this.getSettingsView();
|
||||
App.getChannel().trigger('settingsShowed', this.model.cid);
|
||||
(new ViewType(_.extend({ model: this.model }, options || {}))).render();
|
||||
},
|
||||
showDeletionConfirmation: function showDeletionConfirmation() {
|
||||
@@ -313,6 +314,7 @@ Module.BlockSettingsView = Marionette.View.extend({
|
||||
onBeforeDestroy: function onBeforeDestroy() {
|
||||
MailPoet.Modal.close();
|
||||
this.model.trigger('stopEditing');
|
||||
App.getChannel().trigger('settingsShowed', null);
|
||||
},
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user