diff --git a/packages/mindplot/.eslintrc.json b/packages/mindplot/.eslintrc.json index cc825f6d..2aa693db 100644 --- a/packages/mindplot/.eslintrc.json +++ b/packages/mindplot/.eslintrc.json @@ -9,8 +9,6 @@ "plugin:cypress/recommended" ], "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": true }, diff --git a/packages/mindplot/src/components/DragTopic.js b/packages/mindplot/src/components/DragTopic.js index efb56989..dd027506 100644 --- a/packages/mindplot/src/components/DragTopic.js +++ b/packages/mindplot/src/components/DragTopic.js @@ -81,8 +81,8 @@ class DragTopic { } updateFreeLayout(event) { - const isFreeEnabled = (event.metaKey && Browser.Platform.mac) - || (event.ctrlKey && !Browser.Platform.mac); + const isMac = window.navigator.platform.toUpperCase().indexOf('MAC') >= 0; + const isFreeEnabled = (event.metaKey && isMac) || (event.ctrlKey && !isMac); if (this.isFreeLayoutOn() !== isFreeEnabled) { const dragPivot = this._getDragPivot(); diff --git a/packages/mindplot/src/components/Topic.js b/packages/mindplot/src/components/Topic.js index 6340f691..3c17f3e5 100644 --- a/packages/mindplot/src/components/Topic.js +++ b/packages/mindplot/src/components/Topic.js @@ -640,13 +640,11 @@ class Topic extends NodeGraph { const me = this; // Focus events ... elem.addEvent('mousedown', (event) => { + const isMac = window.navigator.platform.toUpperCase().indexOf('MAC') >= 0; if (!me.isReadOnly()) { // Disable topic selection of readOnly mode ... let value = true; - if ( - (event.metaKey && Browser.Platform.mac) - || (event.ctrlKey && !Browser.Platform.mac) - ) { + if ((event.metaKey && isMac) || (event.ctrlKey && !isMac)) { value = !me.isOnFocus(); event.stopPropagation(); event.preventDefault(); diff --git a/packages/mindplot/src/components/Workspace.js b/packages/mindplot/src/components/Workspace.js index cd9630e7..558a2c81 100644 --- a/packages/mindplot/src/components/Workspace.js +++ b/packages/mindplot/src/components/Workspace.js @@ -178,11 +178,7 @@ class Workspace { workspace.setCoordOrigin(coordOriginX, coordOriginY); // 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(); // Fire drag event ...