Allow dragging text blocks before activating TinyMCE
This commit is contained in:
@@ -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) {
|
||||||
|
@@ -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({
|
||||||
|
Reference in New Issue
Block a user