Activate TinyMCE on click, to fix Interact blocking 2nd and further

focus events
This commit is contained in:
Tautvidas Sipavičius
2016-09-23 15:07:04 +03:00
parent 52bf24b6db
commit fa04173cfb
3 changed files with 28 additions and 0 deletions

View File

@@ -71,11 +71,17 @@ define([
that.model.set('text', editor.getContent());
});
editor.on('click', function(e) {
editor.focus();
});
editor.on('focus', function(e) {
that.disableDragging();
that.disableShowingTools();
});
editor.on('blur', function(e) {
that.enableDragging();
that.enableShowingTools();
});
},
@@ -84,6 +90,12 @@ define([
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({

View File

@@ -71,11 +71,17 @@ define([
that.model.set('text', editor.getContent());
});
editor.on('click', function(e) {
editor.focus(e);
});
editor.on('focus', function(e) {
that.disableDragging();
that.disableShowingTools();
});
editor.on('blur', function(e) {
that.enableDragging();
that.enableShowingTools();
});
},
@@ -84,6 +90,12 @@ define([
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({

View File

@@ -69,6 +69,10 @@ define([
that.model.set('text', editor.getContent());
});
editor.on('click', function(e) {
editor.focus();
});
editor.on('focus', function(e) {
that.disableDragging();
that.disableShowingTools();