Allow dragging text blocks before activating TinyMCE

This commit is contained in:
Tautvidas Sipavičius
2016-09-22 17:44:43 +03:00
parent 4799882b80
commit 50e134d696
2 changed files with 9 additions and 1 deletions

View File

@@ -113,7 +113,7 @@ define([
} }
}, },
}) })
.preventDefault('auto') .preventDefault('never')
.actionChecker(function (pointer, event, action) { .actionChecker(function (pointer, event, action) {
// Disable dragging with right click // Disable dragging with right click
if (event.button !== 0) { if (event.button !== 0) {

View File

@@ -70,10 +70,12 @@ define([
}); });
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();
}); });
}, },
@@ -83,6 +85,12 @@ define([
}); });
} }
}, },
disableDragging: function() {
this.$('.mailpoet_content').addClass('mailpoet_ignore_drag');
},
enableDragging: function() {
this.$('.mailpoet_content').removeClass('mailpoet_ignore_drag');
},
}); });
Module.TextBlockToolsView = base.BlockToolsView.extend({ Module.TextBlockToolsView = base.BlockToolsView.extend({