mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-02-10 18:05:32 +08:00
Fix resizing macro dialog
This commit is contained in:
@ -116,13 +116,6 @@ define([], function () {
|
||||
case 'aceEditorReady':
|
||||
this.fireEvent('ready', cmd.data);
|
||||
break;
|
||||
case 'mouseUp':
|
||||
case 'mouseMove':
|
||||
var offset = Common.Utils.getOffset(this.parentEl);
|
||||
var x = cmd.data.x * Common.Utils.zoom() + offset.left,
|
||||
y = cmd.data.y * Common.Utils.zoom() + offset.top;
|
||||
this.fireEvent(cmd.command.toLowerCase(), x, y);
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -160,6 +153,10 @@ define([], function () {
|
||||
});
|
||||
},
|
||||
|
||||
enablePointerEvents: function(enable) {
|
||||
this.iframe && (this.iframe.style.pointerEvents = enable ? "" : "none");
|
||||
},
|
||||
|
||||
destroyEditor: function() {
|
||||
this._unbindWindowEvents();
|
||||
}
|
||||
|
||||
@ -110,7 +110,15 @@ define([], function () {
|
||||
isFunctionsSupport: this._state.isFunctionsSupport,
|
||||
});
|
||||
|
||||
this.on('help', this.onHelp);
|
||||
this.on({
|
||||
'help': this.onHelp,
|
||||
'drag': function(args){
|
||||
args[0].codeEditor && args[0].codeEditor.enablePointerEvents(args[1]!=='start');
|
||||
},
|
||||
'resize': function(args){
|
||||
args[0].codeEditor && args[0].codeEditor.enablePointerEvents(args[1]!=='start');
|
||||
}
|
||||
});
|
||||
|
||||
Common.UI.Window.prototype.initialize.call(this, _options);
|
||||
},
|
||||
@ -266,14 +274,6 @@ define([], function () {
|
||||
selectedItem.set('value', value);
|
||||
}
|
||||
});
|
||||
this.codeEditor.on('mouseup', function(x, y) {
|
||||
if (me.binding.dragStop) me.binding.dragStop();
|
||||
if (me.binding.resizeStop) me.binding.resizeStop();
|
||||
});
|
||||
this.codeEditor.on('mousemove', function(x, y) {
|
||||
if (me.binding.drag) me.binding.drag({ pageX: x, pageY: y });
|
||||
if (me.binding.resize) me.binding.resize({ pageX: x, pageY: y });
|
||||
});
|
||||
},
|
||||
|
||||
setListMacros: function() {
|
||||
|
||||
12
vendor/ace/component/AceEditor.js
vendored
12
vendor/ace/component/AceEditor.js
vendored
@ -5,8 +5,6 @@
|
||||
* events: {
|
||||
* onChangeValue // text in editor is changed
|
||||
* onEditorReady // editor is ready for use
|
||||
* onMouseUp
|
||||
* onMouseMove
|
||||
* onLoad // frame with editor is loaded
|
||||
* }
|
||||
* }
|
||||
@ -81,16 +79,6 @@
|
||||
handler = events['onEditorReady'];
|
||||
data = cmd.data;
|
||||
break;
|
||||
case 'mouseUp':
|
||||
case 'mouseMove':
|
||||
handler = events[cmd.command==='mouseUp' ? 'onMouseUp' : 'onMouseMove'];
|
||||
var rect = parentEl.getBoundingClientRect(),
|
||||
offset = {
|
||||
top: rect.top + window.pageYOffset,
|
||||
left: rect.left + window.pageXOffset
|
||||
};
|
||||
data = [cmd.data.x + offset.left, cmd.data.y + offset.top]
|
||||
break;
|
||||
}
|
||||
if (handler && typeof handler == "function") {
|
||||
res = handler.call(_self, {target: _self, data: data});
|
||||
|
||||
27
vendor/ace/component/AceEditorCode.js
vendored
27
vendor/ace/component/AceEditorCode.js
vendored
@ -264,36 +264,9 @@ var _postMessage = function(msg) {
|
||||
};
|
||||
|
||||
var fn = function(e) { _onMessage(e); };
|
||||
|
||||
var onMouseUp = function(e) {
|
||||
_postMessage({
|
||||
command: 'mouseUp',
|
||||
data: {
|
||||
x: (undefined === e.clientX) ? e.pageX : e.clientX,
|
||||
y: (undefined === e.clientY) ? e.pageY : e.clientY
|
||||
},
|
||||
referer: 'ace-editor'
|
||||
});
|
||||
};
|
||||
|
||||
var onMouseMove = function(e) {
|
||||
_postMessage({
|
||||
command: 'mouseMove',
|
||||
data: {
|
||||
x: (undefined === e.clientX) ? e.pageX : e.clientX,
|
||||
y: (undefined === e.clientY) ? e.pageY : e.clientY
|
||||
},
|
||||
referer: 'ace-editor'
|
||||
});
|
||||
};
|
||||
|
||||
if (window.attachEvent) {
|
||||
window.attachEvent('onmessage', fn);
|
||||
window.attachEvent("onmouseup", onMouseUp);
|
||||
window.attachEvent("onmousemove", onMouseMove);
|
||||
} else {
|
||||
window.addEventListener('message', fn, false);
|
||||
window.addEventListener("mouseup", onMouseUp, false);
|
||||
window.addEventListener("mousemove", onMouseMove, false);
|
||||
}
|
||||
})(window, undefined);
|
||||
10
vendor/ace/component/example.html
vendored
10
vendor/ace/component/example.html
vendored
@ -65,14 +65,6 @@
|
||||
);
|
||||
};
|
||||
|
||||
var onMouseUp = function (event) {
|
||||
console.log("onMouseUp");
|
||||
};
|
||||
|
||||
var onMouseMove = function (event) {
|
||||
console.log("onMouseMove");
|
||||
};
|
||||
|
||||
var onLoad = function (event) {
|
||||
console.log("onLoad");
|
||||
};
|
||||
@ -82,8 +74,6 @@
|
||||
events: {
|
||||
onChangeValue: onChangeValue,
|
||||
onEditorReady: onEditorReady,
|
||||
onMouseUp: onMouseUp,
|
||||
onMouseMove: onMouseMove,
|
||||
onLoad: onLoad
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user