Activate TinyMCE on click, to fix Interact blocking 2nd and further
focus events
This commit is contained in:
@@ -71,11 +71,17 @@ define([
|
|||||||
that.model.set('text', editor.getContent());
|
that.model.set('text', editor.getContent());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
editor.on('click', function(e) {
|
||||||
|
editor.focus();
|
||||||
|
});
|
||||||
|
|
||||||
editor.on('focus', function(e) {
|
editor.on('focus', function(e) {
|
||||||
|
that.disableDragging();
|
||||||
that.disableShowingTools();
|
that.disableShowingTools();
|
||||||
});
|
});
|
||||||
|
|
||||||
editor.on('blur', function(e) {
|
editor.on('blur', function(e) {
|
||||||
|
that.enableDragging();
|
||||||
that.enableShowingTools();
|
that.enableShowingTools();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -84,6 +90,12 @@ define([
|
|||||||
mailpoet_shortcodes_window_title: MailPoet.I18n.t('shortcodesWindowTitle'),
|
mailpoet_shortcodes_window_title: MailPoet.I18n.t('shortcodesWindowTitle'),
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
disableDragging: function() {
|
||||||
|
this.$('.mailpoet_content').addClass('mailpoet_ignore_drag');
|
||||||
|
},
|
||||||
|
enableDragging: function() {
|
||||||
|
this.$('.mailpoet_content').removeClass('mailpoet_ignore_drag');
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
Module.FooterBlockToolsView = base.BlockToolsView.extend({
|
Module.FooterBlockToolsView = base.BlockToolsView.extend({
|
||||||
|
@@ -71,11 +71,17 @@ define([
|
|||||||
that.model.set('text', editor.getContent());
|
that.model.set('text', editor.getContent());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
editor.on('click', function(e) {
|
||||||
|
editor.focus(e);
|
||||||
|
});
|
||||||
|
|
||||||
editor.on('focus', function(e) {
|
editor.on('focus', function(e) {
|
||||||
|
that.disableDragging();
|
||||||
that.disableShowingTools();
|
that.disableShowingTools();
|
||||||
});
|
});
|
||||||
|
|
||||||
editor.on('blur', function(e) {
|
editor.on('blur', function(e) {
|
||||||
|
that.enableDragging();
|
||||||
that.enableShowingTools();
|
that.enableShowingTools();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -84,6 +90,12 @@ define([
|
|||||||
mailpoet_shortcodes_window_title: MailPoet.I18n.t('shortcodesWindowTitle'),
|
mailpoet_shortcodes_window_title: MailPoet.I18n.t('shortcodesWindowTitle'),
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
disableDragging: function() {
|
||||||
|
this.$('.mailpoet_content').addClass('mailpoet_ignore_drag');
|
||||||
|
},
|
||||||
|
enableDragging: function() {
|
||||||
|
this.$('.mailpoet_content').removeClass('mailpoet_ignore_drag');
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
Module.HeaderBlockToolsView = base.BlockToolsView.extend({
|
Module.HeaderBlockToolsView = base.BlockToolsView.extend({
|
||||||
|
@@ -69,6 +69,10 @@ define([
|
|||||||
that.model.set('text', editor.getContent());
|
that.model.set('text', editor.getContent());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
editor.on('click', function(e) {
|
||||||
|
editor.focus();
|
||||||
|
});
|
||||||
|
|
||||||
editor.on('focus', function(e) {
|
editor.on('focus', function(e) {
|
||||||
that.disableDragging();
|
that.disableDragging();
|
||||||
that.disableShowingTools();
|
that.disableShowingTools();
|
||||||
|
Reference in New Issue
Block a user