diff options
Diffstat (limited to 'js/panels/Splitter.js')
-rwxr-xr-x | js/panels/Splitter.js | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/js/panels/Splitter.js b/js/panels/Splitter.js index 3215e928..98ebb36a 100755 --- a/js/panels/Splitter.js +++ b/js/panels/Splitter.js | |||
@@ -66,6 +66,7 @@ exports.Splitter = Montage.create(Component, { | |||
66 | var storedData = this.application.localStorage.getItem(this.element.getAttribute("data-montage-id")); | 66 | var storedData = this.application.localStorage.getItem(this.element.getAttribute("data-montage-id")); |
67 | if(storedData && this.element.getAttribute("data-montage-id") !== null) { | 67 | if(storedData && this.element.getAttribute("data-montage-id") !== null) { |
68 | this._collapsed = storedData.value; | 68 | this._collapsed = storedData.value; |
69 | |||
69 | } else { | 70 | } else { |
70 | this._collapsed = false; | 71 | this._collapsed = false; |
71 | } | 72 | } |
@@ -77,13 +78,11 @@ exports.Splitter = Montage.create(Component, { | |||
77 | draw: { | 78 | draw: { |
78 | value: function() { | 79 | value: function() { |
79 | if(this.collapsed) { | 80 | if(this.collapsed) { |
80 | |||
81 | if(this.panel.element) this.panel.element.classList.add("collapsed"); | 81 | if(this.panel.element) this.panel.element.classList.add("collapsed"); |
82 | else this.panel.classList.add("collapsed"); | 82 | else this.panel.classList.add("collapsed"); |
83 | this.element.classList.add("collapsed"); | 83 | this.element.classList.add("collapsed"); |
84 | if(this._resizeBar != null) this.resizeBar.classList.add("collapsed"); | 84 | if(this._resizeBar != null) this.resizeBar.classList.add("collapsed"); |
85 | } | 85 | } else { |
86 | else { | ||
87 | if(this.panel.element) this.panel.element.classList.remove("collapsed"); | 86 | if(this.panel.element) this.panel.element.classList.remove("collapsed"); |
88 | else this.panel.classList.remove("collapsed"); | 87 | else this.panel.classList.remove("collapsed"); |
89 | this.element.classList.remove("collapsed"); | 88 | this.element.classList.remove("collapsed"); |
@@ -95,7 +94,11 @@ exports.Splitter = Montage.create(Component, { | |||
95 | handleClick : { | 94 | handleClick : { |
96 | value: function() { | 95 | value: function() { |
97 | if (!this.disabled) { | 96 | if (!this.disabled) { |
98 | this.panel.addEventListener("webkitTransitionEnd", this, false); | 97 | if(this.panel.element) { |
98 | this.panel.element.addEventListener("webkitTransitionEnd", this, false); | ||
99 | } else { | ||
100 | this.panel.addEventListener("webkitTransitionEnd", this, false); | ||
101 | } | ||
99 | this.collapsed = !this.collapsed; | 102 | this.collapsed = !this.collapsed; |
100 | this.needsDraw = true; | 103 | this.needsDraw = true; |
101 | } | 104 | } |
@@ -104,7 +107,12 @@ exports.Splitter = Montage.create(Component, { | |||
104 | 107 | ||
105 | handleWebkitTransitionEnd: { | 108 | handleWebkitTransitionEnd: { |
106 | value: function() { | 109 | value: function() { |
107 | this.panel.removeEventListener("webkitTransitionEnd", this, false); | 110 | if(this.panel.element) { |
111 | this.panel.element.removeEventListener("webkitTransitionEnd", this, false); | ||
112 | } else { | ||
113 | this.panel.removeEventListener("webkitTransitionEnd", this, false); | ||
114 | } | ||
115 | |||
108 | this.application.ninja.stage.resizeCanvases = true; | 116 | this.application.ninja.stage.resizeCanvases = true; |
109 | } | 117 | } |
110 | }, | 118 | }, |