Hide settings when clicked on another block

[MAILPOET-1974]
This commit is contained in:
Ján Mikláš
2019-05-02 13:36:59 +02:00
committed by M. Shull
parent abbd7873fc
commit 5663b1f745
2 changed files with 11 additions and 0 deletions

View File

@@ -226,6 +226,14 @@ Module.BlockToolsView = AugmentedView.extend({
},
changeSettings: function changeSettings(options) {
var ViewType = this.getSettingsView();
var showedSettingsId = App.getShowedSettingsId();
if (showedSettingsId) {
if (showedSettingsId === this.model.cid) {
return;
}
App.getChannel().trigger('hideSettings');
return;
}
App.getChannel().trigger('settingsShowed', this.model.cid);
(new ViewType(_.extend({ model: this.model }, options || {}))).render();
},