diff options
author | John Mayhew | 2012-07-09 17:28:24 -0700 |
---|---|---|
committer | John Mayhew | 2012-07-09 17:28:24 -0700 |
commit | 770bcb52422742ff741a88a75ecefbeb90bc9247 (patch) | |
tree | 64cb3e09a8daeb340261dd7f3869c73f7b90b643 /js/components/treeview/ninja-branch.reel/ninja-branch.js | |
parent | 8c5ecaf90062f9e030386f338bdc19fd62b826c8 (diff) | |
parent | 2b2b5fbb4b6a786daa4e9d4ee9eba9ac78924842 (diff) | |
download | ninja-770bcb52422742ff741a88a75ecefbeb90bc9247.tar.gz |
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal
Conflicts:
manifest.json
Diffstat (limited to 'js/components/treeview/ninja-branch.reel/ninja-branch.js')
-rw-r--r-- | js/components/treeview/ninja-branch.reel/ninja-branch.js | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/js/components/treeview/ninja-branch.reel/ninja-branch.js b/js/components/treeview/ninja-branch.reel/ninja-branch.js index f92a09bc..8df6e987 100644 --- a/js/components/treeview/ninja-branch.reel/ninja-branch.js +++ b/js/components/treeview/ninja-branch.reel/ninja-branch.js | |||
@@ -1,24 +1,25 @@ | |||
1 | /* <copyright> | 1 | /* <copyright> |
2 | Copyright (c) 2012, Motorola Mobility, Inc | 2 | Copyright (c) 2012, Motorola Mobility LLC. |
3 | All Rights Reserved. | 3 | All Rights Reserved. |
4 | BSD License. | ||
5 | 4 | ||
6 | Redistribution and use in source and binary forms, with or without | 5 | Redistribution and use in source and binary forms, with or without |
7 | modification, are permitted provided that the following conditions are met: | 6 | modification, are permitted provided that the following conditions are met: |
8 | 7 | ||
9 | - Redistributions of source code must retain the above copyright notice, | 8 | * Redistributions of source code must retain the above copyright notice, |
10 | this list of conditions and the following disclaimer. | 9 | this list of conditions and the following disclaimer. |
11 | - Redistributions in binary form must reproduce the above copyright | 10 | |
12 | notice, this list of conditions and the following disclaimer in the | 11 | * Redistributions in binary form must reproduce the above copyright notice, |
13 | documentation and/or other materials provided with the distribution. | 12 | this list of conditions and the following disclaimer in the documentation |
14 | - Neither the name of Motorola Mobility nor the names of its contributors | 13 | and/or other materials provided with the distribution. |
15 | may be used to endorse or promote products derived from this software | 14 | |
16 | without specific prior written permission. | 15 | * Neither the name of Motorola Mobility LLC nor the names of its |
16 | contributors may be used to endorse or promote products derived from this | ||
17 | software without specific prior written permission. | ||
17 | 18 | ||
18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
21 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
22 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 23 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
23 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 24 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
24 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 25 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
@@ -71,7 +72,7 @@ var Branch = exports.Branch = Montage.create(TreeNode, { | |||
71 | value: function() { | 72 | value: function() { |
72 | this.collapser.removeAttribute('id'); | 73 | this.collapser.removeAttribute('id'); |
73 | this.label._element.addEventListener('click', this, false); | 74 | this.label._element.addEventListener('click', this, false); |
74 | 75 | ||
75 | if(this.hideLabel) { | 76 | if(this.hideLabel) { |
76 | this.label.element.style.display = "none"; | 77 | this.label.element.style.display = "none"; |
77 | } | 78 | } |
@@ -81,17 +82,17 @@ var Branch = exports.Branch = Montage.create(TreeNode, { | |||
81 | }, | 82 | }, |
82 | handleWebkitTransitionEnd : { | 83 | handleWebkitTransitionEnd : { |
83 | value: function(e) { | 84 | value: function(e) { |
84 | e.stopPropagation(); | 85 | e.stopPropagation(); |
85 | 86 | ||
86 | ///// Remove Transition | 87 | ///// Remove Transition |
87 | this._removeTransition = true; | 88 | this._removeTransition = true; |
88 | this.collapser.removeEventListener('webkitTransitionEnd', this, false); | 89 | this.collapser.removeEventListener('webkitTransitionEnd', this, false); |
89 | 90 | ||
90 | //// If it's an expand transition, restore height to auto | 91 | //// If it's an expand transition, restore height to auto |
91 | if(this.isExpanded) { | 92 | if(this.isExpanded) { |
92 | this._switchToAuto = true; | 93 | this._switchToAuto = true; |
93 | } | 94 | } |
94 | 95 | ||
95 | this.needsDraw = true; | 96 | this.needsDraw = true; |
96 | 97 | ||
97 | } | 98 | } |
@@ -114,9 +115,9 @@ var Branch = exports.Branch = Montage.create(TreeNode, { | |||
114 | if (this.sourceObject[this.labelKey]) { | 115 | if (this.sourceObject[this.labelKey]) { |
115 | this._labelText = this.sourceObject[this.labelKey]; | 116 | this._labelText = this.sourceObject[this.labelKey]; |
116 | } | 117 | } |
117 | 118 | ||
118 | if(this._doCollapse) { | 119 | if(this._doCollapse) { |
119 | if (this._step === 0) { | 120 | if (this._step === 0) { |
120 | this.collapser.style.height = this.branchHeight; | 121 | this.collapser.style.height = this.branchHeight; |
121 | this.collapser.style.position = "relative"; | 122 | this.collapser.style.position = "relative"; |
122 | this.collapser.style.overflow = 'hidden'; | 123 | this.collapser.style.overflow = 'hidden'; |
@@ -135,15 +136,15 @@ var Branch = exports.Branch = Montage.create(TreeNode, { | |||
135 | } | 136 | } |
136 | } else if(this._doExpand) { | 137 | } else if(this._doExpand) { |
137 | this.collapser.style.height = this.branchHeight; | 138 | this.collapser.style.height = this.branchHeight; |
138 | 139 | ||
139 | this._doExpand = false; | 140 | this._doExpand = false; |
140 | } | 141 | } |
141 | if(this._switchToAuto) { | 142 | if(this._switchToAuto) { |
142 | this.collapser.childNodes[1].style.position = 'static'; | 143 | this.collapser.childNodes[1].style.position = 'static'; |
143 | this.collapser.style.height = 'auto'; | 144 | this.collapser.style.height = 'auto'; |
144 | this._switchToAuto = false; | 145 | this._switchToAuto = false; |
145 | } | 146 | } |
146 | 147 | ||
147 | if(this._removeTransition) { | 148 | if(this._removeTransition) { |
148 | this.collapser.classList.remove(this.collapseClass); | 149 | this.collapser.classList.remove(this.collapseClass); |
149 | this._removeTransition = false; | 150 | this._removeTransition = false; |
@@ -167,7 +168,7 @@ var Branch = exports.Branch = Montage.create(TreeNode, { | |||
167 | }, | 168 | }, |
168 | collapse : { | 169 | collapse : { |
169 | value: function() { | 170 | value: function() { |
170 | this.needsDraw = this._doCollapse = true; | 171 | this.needsDraw = this._doCollapse = true; |
171 | } | 172 | } |
172 | }, | 173 | }, |
173 | branchHeight: { | 174 | branchHeight: { |