From 1ba1d4e46d9481cc03b00ed912a53b2b313a28b5 Mon Sep 17 00:00:00 2001 From: Jorge Lopes Date: Fri, 28 Jun 2019 11:32:03 +0100 Subject: [PATCH] fix: toolType to toolName --- src/stateManagement/toolState.js | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/stateManagement/toolState.js b/src/stateManagement/toolState.js index dae1b4414..182187d52 100755 --- a/src/stateManagement/toolState.js +++ b/src/stateManagement/toolState.js @@ -30,18 +30,18 @@ function getElementToolStateManager(element) { * @method addToolState * * @param {HTMLElement} element The element. - * @param {string} toolType The toolType of the state. + * @param {string} toolName The toolName of the state. * @param {Object} measurementData The data to store in the state. * @returns {undefined} */ -function addToolState(element, toolType, measurementData) { +function addToolState(element, toolName, measurementData) { const toolStateManager = getElementToolStateManager(element); - toolStateManager.add(element, toolType, measurementData); + toolStateManager.add(element, toolName, measurementData); const eventType = EVENTS.MEASUREMENT_ADDED; const eventData = { - toolType, + toolName, element, measurementData, }; @@ -58,13 +58,13 @@ function addToolState(element, toolType, measurementData) { * @name getToolState * * @param {HTMLElement} element The element. - * @param {string} toolType The toolType of the state. - * @returns {Object} The element's state for the given toolType. + * @param {string} toolName The toolName of the state. + * @returns {Object} The element's state for the given toolName. */ -function getToolState(element, toolType) { +function getToolState(element, toolName) { const toolStateManager = getElementToolStateManager(element); - return toolStateManager.get(element, toolType); + return toolStateManager.get(element, toolName); } /** @@ -73,13 +73,13 @@ function getToolState(element, toolType) { * @method removeToolState * * @param {HTMLElement} element The element. - * @param {string} toolType The toolType of the state. + * @param {string} toolName The toolName of the state. * @param {Object} data The data to remove from the toolStateManager. * @returns {undefined} */ -function removeToolState(element, toolType, data) { +function removeToolState(element, toolName, data) { const toolStateManager = getElementToolStateManager(element); - const toolData = toolStateManager.get(element, toolType); + const toolData = toolStateManager.get(element, toolName); // Find this tool data let indexOfData = -1; @@ -94,7 +94,7 @@ function removeToolState(element, toolType, data) { const eventType = EVENTS.MEASUREMENT_REMOVED; const eventData = { - toolType, + toolName, element, measurementData: data, }; @@ -105,17 +105,17 @@ function removeToolState(element, toolType, data) { /** * Removes all toolState from the toolStateManager corresponding to - * the toolType and element. + * the toolName and element. * @public * @method clearToolState * * @param {HTMLElement} element The element. - * @param {string} toolType The toolType of the state. + * @param {string} toolName The toolName of the state. * @returns {undefined} */ -function clearToolState(element, toolType) { +function clearToolState(element, toolName) { const toolStateManager = getElementToolStateManager(element); - const toolData = toolStateManager.get(element, toolType); + const toolData = toolStateManager.get(element, toolName); // If any toolData actually exists, clear it if (toolData !== undefined) {