diff options
author | Jose Antonio Marquez | 2012-02-28 13:33:17 -0800 |
---|---|---|
committer | Jose Antonio Marquez | 2012-02-28 13:33:17 -0800 |
commit | f7c08fe5a8424d8c7837a4e3a975e63bcddc3b14 (patch) | |
tree | 77a3d7edeefa60d9096b2b3368be11374f354b74 /js/panels/Splitter.js | |
parent | 811d5092345bf520f6a683eec89cf7d8ed7aa490 (diff) | |
parent | 7c9291a5bab4abd849547f8878f6fb962fc88250 (diff) | |
download | ninja-f7c08fe5a8424d8c7837a4e3a975e63bcddc3b14.tar.gz |
Merge branch 'refs/heads/NinjaInternal' into FileIO-Build-Candidate
Diffstat (limited to 'js/panels/Splitter.js')
-rwxr-xr-x | js/panels/Splitter.js | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/js/panels/Splitter.js b/js/panels/Splitter.js index 9f5b4de7..3215e928 100755 --- a/js/panels/Splitter.js +++ b/js/panels/Splitter.js | |||
@@ -9,6 +9,10 @@ var Component = require("montage/ui/component").Component; | |||
9 | 9 | ||
10 | exports.Splitter = Montage.create(Component, { | 10 | exports.Splitter = Montage.create(Component, { |
11 | 11 | ||
12 | version: { | ||
13 | value: "1.0" | ||
14 | }, | ||
15 | |||
12 | hasTemplate: { | 16 | hasTemplate: { |
13 | value: false | 17 | value: false |
14 | }, | 18 | }, |
@@ -49,19 +53,23 @@ exports.Splitter = Montage.create(Component, { | |||
49 | get: function() { | 53 | get: function() { |
50 | return this._collapsed; | 54 | return this._collapsed; |
51 | }, | 55 | }, |
52 | set: function(value) | 56 | set: function(value) { |
53 | { | ||
54 | this._collapsed = value; | 57 | this._collapsed = value; |
55 | this.application.ninja.settings.setSetting(this.element.id, "collapsed", this.collapsed); | 58 | |
59 | this.application.localStorage.setItem(this.element.getAttribute("data-montage-id"), {"version": this.version, "value": value}); | ||
56 | } | 60 | } |
57 | }, | 61 | }, |
58 | 62 | ||
59 | prepareForDraw: { | 63 | prepareForDraw: { |
60 | value: function() { | 64 | value: function() { |
61 | //Get Setting from SettingManager | 65 | //Get splitter initial value from SettingManager |
62 | this.application.ninja.settings.getSetting(this.element.id, "collapsed"); | 66 | var storedData = this.application.localStorage.getItem(this.element.getAttribute("data-montage-id")); |
63 | lapsed = false; | 67 | if(storedData && this.element.getAttribute("data-montage-id") !== null) { |
64 | if (lapsed != null) this._collapsed = lapsed; | 68 | this._collapsed = storedData.value; |
69 | } else { | ||
70 | this._collapsed = false; | ||
71 | } | ||
72 | |||
65 | this.element.addEventListener("click", this, false); | 73 | this.element.addEventListener("click", this, false); |
66 | } | 74 | } |
67 | }, | 75 | }, |