Mercurial > pub > ImplabJs
diff src/djol/ToolBoxController.js @ 34:27e8e9e38e07 default tip
Слияние
author | nickolay |
---|---|
date | Wed, 05 Jun 2019 20:44:15 +0300 |
parents | 8af8e840dd49 1dc2fd263b90 |
children |
line wrap: on
line diff
--- a/src/djol/ToolBoxController.js Wed Jun 05 17:44:17 2019 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -define([ - "dojo/_base/declare", - "implab/safe", - "implab/components/ActivationController", - "./ToolType" ], - -function(declare, safe, ActivationController, ToolType) { - return declare([ ActivationController ], { - _stack : null, - _tools : null, - - constructor : function() { - this._stack = new Array(); - this._tools = new Array(); - }, - - activate : function(tool) { - safe.argumentNotNull(tool, "tool"); - - var me = this, current = me.getCurrent(); - - return this.inherited(arguments).then(function(success) { - if (success) { - if (tool.toolType == ToolType.Oneshot && current) - me._stack.push(current); - else - me._stack = []; - } - return success; - }); - }, - - deactivate : function() { - var me = this; - return me.inherited(arguments).then(function(success) { - if (success && me._stack.length) - return me.activate(me._stack.pop()); - - return success; - }); - } - }); -}); \ No newline at end of file