Remove Browser object

This commit is contained in:
Paulo Gustavo Veiga 2021-12-23 09:56:36 -08:00
parent c2189a31fa
commit 76dcadccd6
4 changed files with 5 additions and 13 deletions

View File

@ -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
},

View File

@ -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();

View File

@ -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();

View File

@ -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 ...