Don't show editor controls when dragging or resizing

[MAILPOET-1727]
This commit is contained in:
Ján Mikláš
2019-02-12 13:15:50 +01:00
committed by M. Shull
parent 6cabecbe52
commit 45f4cdaf33
3 changed files with 15 additions and 3 deletions

View File

@@ -66,7 +66,11 @@ define([
that.$el.removeClass('mailpoet_resize_active');
});
},
showResizeHandle: function () { // eslint-disable-line func-names
showResizeHandle: function (mouseEvent) { // eslint-disable-line func-names
// Skip if user is dragging/resizing
if (!this.isBeingResized && mouseEvent && mouseEvent.buttons > 0) {
return;
}
if (typeof this.options.resizeHandleSelector === 'string') {
this.view.$(this.options.resizeHandleSelector).removeClass('mailpoet_hidden');
}

View File

@@ -107,7 +107,11 @@ define([
this.on('dom:refresh', this.showBlock, this);
this._isFirstRender = true;
},
showTools: function showTools() {
showTools: function showTools(mouseEvent) {
// Skip if user is dragging/resizing
if (mouseEvent && mouseEvent.buttons > 0) {
return;
}
if (!this.showingToolsDisabled) {
this.$('> .mailpoet_tools').addClass('mailpoet_display_tools');
this.toolsView.triggerMethod('showTools');

View File

@@ -192,7 +192,11 @@ define([
this.$('> .mailpoet_container').attr('class',
'mailpoet_container mailpoet_container_' + this.model.get('orientation') + ' ' + classIrregular);
},
showTools: function () {
showTools: function (mouseEvent) {
// Skip if user is dragging/resizing
if (mouseEvent && mouseEvent.buttons > 0) {
return;
}
if (this.renderOptions.depth === 1 && !this.$el.hasClass('mailpoet_container_layer_active')) {
this.$(this.ui.tools).addClass('mailpoet_display_tools');
this.$el.addClass('mailpoet_highlight');