From feed5ffc6d4eedfad6e62b51b140c2dc58e3b4fd Mon Sep 17 00:00:00 2001 From: Andrew n marshall Date: Tue, 14 Feb 2017 09:35:11 -0800 Subject: [PATCH] Renamed extension function constant, and moved variables into the mixin. --- blocks/logic.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/blocks/logic.js b/blocks/logic.js index d273f108f..a9d165314 100644 --- a/blocks/logic.js +++ b/blocks/logic.js @@ -303,6 +303,9 @@ Blockly.Extensions.register('logic_op_tooltip', * @readonly */ Blockly.Constants.Logic.CONTROLS_IF_MUTATOR_MIXIN = { + elseifCount_: 0, + elseCount_: 0, + /** * Create XML to represent the number of else-if and else inputs. * @return {Element} XML storage element. @@ -460,11 +463,9 @@ Blockly.Constants.Logic.CONTROLS_IF_MUTATOR_MIXIN = { * @this Blockly.Block * @package */ -Blockly.Constants.Logic.CONTROLS_IF_EXTENSION = function() { +Blockly.Constants.Logic.CONTROLS_IF_MUTATOR_EXTENSION = function() { this.setMutator(new Blockly.Mutator(['controls_if_elseif', 'controls_if_else'])); this.mixin(Blockly.Constants.Logic.CONTROLS_IF_MUTATOR_MIXIN); - this.elseifCount_ = 0; - this.elseCount_ = 0; this.setTooltip(function() { if (!this.elseifCount_ && !this.elseCount_) { @@ -481,7 +482,7 @@ Blockly.Constants.Logic.CONTROLS_IF_EXTENSION = function() { }; Blockly.Extensions.register('controls_if_mutator', - Blockly.Constants.Logic.CONTROLS_IF_EXTENSION); + Blockly.Constants.Logic.CONTROLS_IF_MUTATOR_EXTENSION); /** * Corrects the logic_compate dropdown label with respect to language direction.