Better naming
[MAILPOET-1974]
This commit is contained in:
@@ -33,7 +33,7 @@ var EditorApplication = Marionette.Application.extend({
|
|||||||
onStart: function onStart() {
|
onStart: function onStart() {
|
||||||
this._appView = new AppView();
|
this._appView = new AppView();
|
||||||
this.showView(this._appView);
|
this.showView(this._appView);
|
||||||
this.listenTo(this.getChannel(), 'settingsShowed', this.setShowedSettingsId);
|
this.listenTo(this.getChannel(), 'settingsDisplayed', this.setDisplayedSettingsId);
|
||||||
},
|
},
|
||||||
|
|
||||||
getChannel: function getChannel(channel) {
|
getChannel: function getChannel(channel) {
|
||||||
@@ -43,12 +43,12 @@ var EditorApplication = Marionette.Application.extend({
|
|||||||
return Radio.channel(channel);
|
return Radio.channel(channel);
|
||||||
},
|
},
|
||||||
|
|
||||||
getShowedSettingsId: function getShowedSettingsId() {
|
getDisplayedSettingsId: function getDisplayedSettingsId() {
|
||||||
return this.showedSettingsId;
|
return this.displayedSettingsId;
|
||||||
},
|
},
|
||||||
|
|
||||||
setShowedSettingsId: function setShowedSettingsId(id) {
|
setDisplayedSettingsId: function setDisplayedSettingsId(id) {
|
||||||
this.showedSettingsId = id;
|
this.displayedSettingsId = id;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -26,7 +26,7 @@ BL.HighlightEditingBehavior = Marionette.Behavior.extend({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Ignore mouse events when settings panel is showed
|
// Ignore mouse events when settings panel is showed
|
||||||
if (App.getShowedSettingsId()) {
|
if (App.getDisplayedSettingsId()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.view.addHighlight();
|
this.view.addHighlight();
|
||||||
@@ -55,7 +55,7 @@ BL.HighlightEditingBehavior = Marionette.Behavior.extend({
|
|||||||
},
|
},
|
||||||
onStopResizing: function onStopResizing(event) {
|
onStopResizing: function onStopResizing(event) {
|
||||||
this.isFocusedByPointer = isEventInsideElement(event, this.view.$el);
|
this.isFocusedByPointer = isEventInsideElement(event, this.view.$el);
|
||||||
if (!App.getShowedSettingsId()) {
|
if (!App.getDisplayedSettingsId()) {
|
||||||
this.onStopEditing();
|
this.onStopEditing();
|
||||||
}
|
}
|
||||||
this.view.triggerMethod('resizeStop', event);
|
this.view.triggerMethod('resizeStop', event);
|
||||||
|
@@ -71,7 +71,7 @@ BL.TextEditorBehavior = Marionette.Behavior.extend({
|
|||||||
});
|
});
|
||||||
|
|
||||||
editor.on('click', function onClick(e) {
|
editor.on('click', function onClick(e) {
|
||||||
if (App.getShowedSettingsId()) {
|
if (App.getDisplayedSettingsId()) {
|
||||||
App.getChannel().trigger('hideSettings');
|
App.getChannel().trigger('hideSettings');
|
||||||
}
|
}
|
||||||
// if caret not in editor, place it there (triggers focus on editor)
|
// if caret not in editor, place it there (triggers focus on editor)
|
||||||
|
@@ -226,15 +226,15 @@ Module.BlockToolsView = AugmentedView.extend({
|
|||||||
},
|
},
|
||||||
changeSettings: function changeSettings(options) {
|
changeSettings: function changeSettings(options) {
|
||||||
var ViewType = this.getSettingsView();
|
var ViewType = this.getSettingsView();
|
||||||
var showedSettingsId = App.getShowedSettingsId();
|
var displayedSettingsId = App.getDisplayedSettingsId();
|
||||||
if (showedSettingsId) {
|
if (displayedSettingsId) {
|
||||||
if (showedSettingsId === this.model.cid) {
|
if (displayedSettingsId === this.model.cid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
App.getChannel().trigger('hideSettings');
|
App.getChannel().trigger('hideSettings');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
App.getChannel().trigger('settingsShowed', this.model.cid);
|
App.getChannel().trigger('settingsDisplayed', this.model.cid);
|
||||||
(new ViewType(_.extend({ model: this.model }, options || {}))).render();
|
(new ViewType(_.extend({ model: this.model }, options || {}))).render();
|
||||||
},
|
},
|
||||||
showDeletionConfirmation: function showDeletionConfirmation() {
|
showDeletionConfirmation: function showDeletionConfirmation() {
|
||||||
@@ -326,7 +326,7 @@ Module.BlockSettingsView = Marionette.View.extend({
|
|||||||
onBeforeDestroy: function onBeforeDestroy() {
|
onBeforeDestroy: function onBeforeDestroy() {
|
||||||
MailPoet.Modal.close();
|
MailPoet.Modal.close();
|
||||||
this.model.trigger('stopEditing');
|
this.model.trigger('stopEditing');
|
||||||
App.getChannel().trigger('settingsShowed', null);
|
App.getChannel().trigger('settingsDisplayed', null);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user