Lose focus on any active element when clicked into empty space in newsletter
[MAILPOET-1811]
This commit is contained in:
committed by
Pavel Dohnal
parent
757335bce7
commit
2e5359b7ee
@@ -79,6 +79,9 @@ Module.ContainerBlockModel = base.BlockModel.extend({
|
|||||||
|
|
||||||
Module.ContainerBlocksView = Marionette.CollectionView.extend({
|
Module.ContainerBlocksView = Marionette.CollectionView.extend({
|
||||||
className: 'mailpoet_container',
|
className: 'mailpoet_container',
|
||||||
|
events: {
|
||||||
|
click: 'removeFocusFromAnyActiveElement',
|
||||||
|
},
|
||||||
childView: function (model) {
|
childView: function (model) {
|
||||||
return App.getBlockTypeView(model.get('type'));
|
return App.getBlockTypeView(model.get('type'));
|
||||||
},
|
},
|
||||||
@@ -102,6 +105,15 @@ Module.ContainerBlocksView = Marionette.CollectionView.extend({
|
|||||||
onChildviewResizeStop: function onChildviewResizeStart(event) {
|
onChildviewResizeStop: function onChildviewResizeStart(event) {
|
||||||
this.triggerMethod('resizeStop', event);
|
this.triggerMethod('resizeStop', event);
|
||||||
},
|
},
|
||||||
|
removeFocusFromAnyActiveElement: function removeFocusFromAnyActiveElement(event) {
|
||||||
|
if (!event || !event.target) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (event.target.className.indexOf('mailpoet_container_horizontal') === -1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
document.activeElement.blur();
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
Module.ContainerBlockView = base.BlockView.extend({
|
Module.ContainerBlockView = base.BlockView.extend({
|
||||||
|
Reference in New Issue
Block a user