diff options
| author | Alon Levy <alon@pobox.com> | 2015-01-27 11:53:45 +0200 |
|---|---|---|
| committer | Alon Levy <alon@pobox.com> | 2015-01-27 11:53:45 +0200 |
| commit | dff333b558cb29f1c6fa6d13ee4239a9bc0a81a6 (patch) | |
| tree | 881a08eda7433fc478d219e6302640dd04ccef18 /src/client/view/tab.js | |
| parent | 19d9fad85ad6dacd419530f3d9d26f952b663c11 (diff) | |
client: remove state variable in node view and use bacon property instead
Diffstat (limited to 'src/client/view/tab.js')
| -rw-r--r-- | src/client/view/tab.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/client/view/tab.js b/src/client/view/tab.js index 97ba1351..9fca9a29 100644 --- a/src/client/view/tab.js +++ b/src/client/view/tab.js @@ -1,12 +1,13 @@ "use strict" -define(['jquery'], -function($) { +define(['jquery', 'Bacon'], +function($, Bacon) { function Tab(dict) { var k, selector = {}, - name = []; + name = [], + openessBus = new Bacon.Bus(); for (k in dict) { if (dict.hasOwnProperty(k) == false) { @@ -17,6 +18,8 @@ function Tab(dict) { } this._selector = selector; this._name = name; + this._openessBus = openessBus; + this.isOpenProperty = openessBus.toProperty(false) } Tab.prototype.show = function(shown_name) { @@ -33,6 +36,7 @@ Tab.prototype.show = function(shown_name) { element.hide(); } } + this._openessBus.push(true); } Tab.prototype.hide = function() { @@ -41,6 +45,7 @@ Tab.prototype.hide = function() { for (i = 0 ; i < this._name.length ; ++i) { $(this._selector[this._name[i]]).fadeOut(300); } + this._openessBus.push(false); } Tab.prototype.get = function(name, sel) { |
