From 3fd73f92f2e1033f99c7ebd3190b95379c4e983b Mon Sep 17 00:00:00 2001 From: sasensi Date: Wed, 17 Oct 2018 12:05:56 +0200 Subject: [PATCH] Minor code refactoring --- src/view/View.js | 21 +++++---------------- test/helpers.js | 2 +- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/src/view/View.js b/src/view/View.js index 935989a6..99690f71 100644 --- a/src/view/View.js +++ b/src/view/View.js @@ -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; } } }; diff --git a/test/helpers.js b/test/helpers.js index 1cfd30b3..027922e7 100644 --- a/test/helpers.js +++ b/test/helpers.js @@ -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