fix(devtools): remove runOutsideAngular wrapper on mouse move event

This commit is contained in:
AleksanderBodurri
2020-04-23 12:29:23 -04:00
committed by Minko Gechev
parent 1e52023fef
commit e55a24cf30
+9 -12
View File
@@ -2,7 +2,6 @@ import { initializeMessageBus } from 'ng-devtools-backend';
import { SamePageMessageBus } from './same-page-message-bus';
import { initializeExtendedWindowOperations } from './chrome-window-extensions';
import { unHighlight } from '../../../ng-devtools-backend/src/lib/highlighter';
import { runOutsideAngular } from '../../../ng-devtools-backend/src/lib/utils';
const messageBus = new SamePageMessageBus('angular-devtools-backend', 'angular-devtools-content-script');
@@ -27,15 +26,13 @@ messageBus.on('handshake', () => {
// handles case when mouse leaves chrome extension too quickly. unHighlight() is not a very expensive function
// and has an if check so it's DOM api call is not called more than necessary
runOutsideAngular(() => {
document.addEventListener(
'mousemove',
() => {
if (!inspectorRunning) {
unHighlight();
}
},
false
);
});
document.addEventListener(
'mousemove',
() => {
if (!inspectorRunning) {
unHighlight();
}
},
false
);
});