Minor code refactoring

This commit is contained in:
sasensi 2018-10-17 12:05:56 +02:00 committed by Jürg Lehni
parent 1bd67b2d9b
commit 3fd73f92f2
2 changed files with 6 additions and 17 deletions

View file

@ -1506,22 +1506,11 @@ new function() { // Injection scope for event handling on the browser
* test.
* @private
*/
_clearState: function() {
prevFocus = null;
tempFocus = null;
dragging = false;
mouseDown = false;
called = false;
wasInView = false;
overView = null;
downPoint = null;
lastPoint = null;
downItem = null;
overItem = null;
dragItem = null;
clickItem = null;
clickTime = null;
dblClick = null;
_resetState: function() {
dragging = mouseDown = called = wasInView = false;
prevFocus = tempFocus = overView = downPoint = lastPoint =
downItem = overItem = dragItem = clickItem = clickTime =
dblClick = null;
}
}
};

View file

@ -69,7 +69,7 @@ var test = function(testName, expected) {
currentProject.remove();
// This is needed for interactions tests, to make sure that test is
// run with a fresh state.
View._clearState();
View._resetState();
}
// Instantiate project with 100x100 pixels canvas instead of default