mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-22 22:57:57 +01:00
Remove Browser object
This commit is contained in:
parent
c2189a31fa
commit
76dcadccd6
@ -9,8 +9,6 @@
|
|||||||
"plugin:cypress/recommended"
|
"plugin:cypress/recommended"
|
||||||
],
|
],
|
||||||
"globals": {
|
"globals": {
|
||||||
// Browser is a mootools polyfill. Remove when moving from browser checks to feature detection
|
|
||||||
"Browser": true,
|
|
||||||
// designer is a global currently used as a hack. Remove this when fixing the hack.
|
// designer is a global currently used as a hack. Remove this when fixing the hack.
|
||||||
"designer": true
|
"designer": true
|
||||||
},
|
},
|
||||||
|
@ -81,8 +81,8 @@ class DragTopic {
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateFreeLayout(event) {
|
updateFreeLayout(event) {
|
||||||
const isFreeEnabled = (event.metaKey && Browser.Platform.mac)
|
const isMac = window.navigator.platform.toUpperCase().indexOf('MAC') >= 0;
|
||||||
|| (event.ctrlKey && !Browser.Platform.mac);
|
const isFreeEnabled = (event.metaKey && isMac) || (event.ctrlKey && !isMac);
|
||||||
|
|
||||||
if (this.isFreeLayoutOn() !== isFreeEnabled) {
|
if (this.isFreeLayoutOn() !== isFreeEnabled) {
|
||||||
const dragPivot = this._getDragPivot();
|
const dragPivot = this._getDragPivot();
|
||||||
|
@ -640,13 +640,11 @@ class Topic extends NodeGraph {
|
|||||||
const me = this;
|
const me = this;
|
||||||
// Focus events ...
|
// Focus events ...
|
||||||
elem.addEvent('mousedown', (event) => {
|
elem.addEvent('mousedown', (event) => {
|
||||||
|
const isMac = window.navigator.platform.toUpperCase().indexOf('MAC') >= 0;
|
||||||
if (!me.isReadOnly()) {
|
if (!me.isReadOnly()) {
|
||||||
// Disable topic selection of readOnly mode ...
|
// Disable topic selection of readOnly mode ...
|
||||||
let value = true;
|
let value = true;
|
||||||
if (
|
if ((event.metaKey && isMac) || (event.ctrlKey && !isMac)) {
|
||||||
(event.metaKey && Browser.Platform.mac)
|
|
||||||
|| (event.ctrlKey && !Browser.Platform.mac)
|
|
||||||
) {
|
|
||||||
value = !me.isOnFocus();
|
value = !me.isOnFocus();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
@ -178,11 +178,7 @@ class Workspace {
|
|||||||
workspace.setCoordOrigin(coordOriginX, coordOriginY);
|
workspace.setCoordOrigin(coordOriginX, coordOriginY);
|
||||||
|
|
||||||
// Change cursor.
|
// Change cursor.
|
||||||
if (Browser.firefox) {
|
|
||||||
window.document.body.style.cursor = '-moz-grabbing';
|
|
||||||
} else {
|
|
||||||
window.document.body.style.cursor = 'move';
|
window.document.body.style.cursor = 'move';
|
||||||
}
|
|
||||||
mouseMoveEvent.preventDefault();
|
mouseMoveEvent.preventDefault();
|
||||||
|
|
||||||
// Fire drag event ...
|
// Fire drag event ...
|
||||||
|
Loading…
Reference in New Issue
Block a user