Hide settings on click outside email content

[MAILPOET-1974]
This commit is contained in:
Ján Mikláš
2019-05-02 14:25:46 +02:00
committed by M. Shull
parent f3301dea3a
commit 84b275a624

View File

@@ -1,5 +1,6 @@
import Marionette from 'backbone.marionette';
import BackboneRadio from 'backbone.radio';
import jQuery from 'jquery';
var Radio = BackboneRadio;
@@ -13,6 +14,17 @@ var AppView = Marionette.View.extend({
headingRegion: '#mailpoet_editor_heading',
topRegion: '#mailpoet_editor_top',
},
events: {
click: 'onClickOutsideContentHideSettings',
},
onClickOutsideContentHideSettings: function onClickOutsideContentHideSettings(event) {
if (jQuery(event.target).parents('#mailpoet_editor_content').length) {
return;
}
window.EditorApplication.getChannel().trigger('hideSettings');
},
});
var EditorApplication = Marionette.Application.extend({