aboutsummaryrefslogtreecommitdiff
path: root/node_modules/montage/ui/scroller.reel/scroller.js
diff options
context:
space:
mode:
authorValerio Virgillito2012-04-18 13:48:51 -0700
committerValerio Virgillito2012-04-18 13:48:51 -0700
commit2e04af953463643791f6362bd8ef4c6ba190abfa (patch)
treed07aaf646091ddf9dad5b030a7905055fd323490 /node_modules/montage/ui/scroller.reel/scroller.js
parent616a8532099fec2a15855eac97cd85cb60c4451c (diff)
downloadninja-2e04af953463643791f6362bd8ef4c6ba190abfa.tar.gz
Squashed commit of the following:
commit 2054551bfb01a0f4ca2e138b9d724835462d45cd Merge: 765c2da 616a853 Author: Valerio Virgillito <valerio@motorola.com> Date: Wed Apr 18 13:48:21 2012 -0700 Merge branch 'refs/heads/master' into integration commit 765c2da8e1aa03550caf42b2bd5f367555ad2843 Author: Valerio Virgillito <valerio@motorola.com> Date: Tue Apr 17 15:29:41 2012 -0700 updating the picasa carousel Signed-off-by: Valerio Virgillito <valerio@motorola.com> commit 9484f1c82b81e27edf2dc0a1bcc1fa3b12077406 Merge: d27f2df cacb4a2 Author: Valerio Virgillito <valerio@motorola.com> Date: Tue Apr 17 15:03:50 2012 -0700 Merge branch 'refs/heads/master' into integration commit d27f2df4d846064444263d7832d213535962abe7 Author: Valerio Virgillito <valerio@motorola.com> Date: Wed Apr 11 10:39:36 2012 -0700 integrating new picasa carousel component Signed-off-by: Valerio Virgillito <valerio@motorola.com> commit 6f98384c9ecbc8abe55ccfe1fc25a0c7ce22c493 Author: Valerio Virgillito <valerio@motorola.com> Date: Tue Apr 10 14:33:00 2012 -0700 fixed the text area case issue Text area was renamed from TextArea to Textarea Signed-off-by: Valerio Virgillito <valerio@motorola.com> commit 1e83e26652266136802bc7af930379c1ecd631a6 Author: Valerio Virgillito <valerio@motorola.com> Date: Mon Apr 9 22:10:45 2012 -0700 integrating montage v0.8 into ninja. Signed-off-by: Valerio Virgillito <valerio@motorola.com> Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'node_modules/montage/ui/scroller.reel/scroller.js')
-rw-r--r--node_modules/montage/ui/scroller.reel/scroller.js49
1 files changed, 9 insertions, 40 deletions
diff --git a/node_modules/montage/ui/scroller.reel/scroller.js b/node_modules/montage/ui/scroller.reel/scroller.js
index b578807e..8c367cd1 100644
--- a/node_modules/montage/ui/scroller.reel/scroller.js
+++ b/node_modules/montage/ui/scroller.reel/scroller.js
@@ -5,8 +5,7 @@
5 </copyright> */ 5 </copyright> */
6 6
7var Montage = require("montage").Montage, 7var Montage = require("montage").Montage,
8 Component = require("ui/component").Component 8 Component = require("ui/component").Component;
9 TranslateComposer = require("ui/composer/translate-composer").TranslateComposer;
10 9
11exports.Scroller = Montage.create(Component, { 10exports.Scroller = Montage.create(Component, {
12 11
@@ -116,40 +115,6 @@ exports.Scroller = Montage.create(Component, {
116 } 115 }
117 }, 116 },
118 117
119 _momentumDuration: {
120 enumerable: false,
121 value: 650
122 },
123
124 momentumDuration: {
125 get: function () {
126 return this._momentumDuration;
127 },
128 set: function (value) {
129 this._momentumDuration = isNaN(parseInt(value, 10)) ? 1 : parseInt(value, 10);
130 if (this._momentumDuration < 1) {
131 this._momentumDuration = 1;
132 }
133 }
134 },
135
136 _bouncingDuration: {
137 enumerable: false,
138 value: 750
139 },
140
141 bouncingDuration: {
142 get: function () {
143 return this._bouncingDuration;
144 },
145 set: function (value) {
146 this._bouncingDuration = isNaN(parseInt(value, 10)) ? 1 : parseInt(value, 10);
147 if (this._bouncingDuration < 1) {
148 this._bouncingDuration = 1;
149 }
150 }
151 },
152
153 _content: { 118 _content: {
154 enumerable: false, 119 enumerable: false,
155 value: null 120 value: null
@@ -157,11 +122,15 @@ exports.Scroller = Montage.create(Component, {
157 122
158 templateDidLoad: { 123 templateDidLoad: {
159 value: function () { 124 value: function () {
160 var orphanedFragment, 125 var orphanedFragment = document.createDocumentFragment(),
161 currentContentRange = this.element.ownerDocument.createRange(); 126 children = this.element.childNodes;
162 127
163 currentContentRange.selectNodeContents(this.element); 128
164 orphanedFragment = currentContentRange.extractContents(); 129 while (children.length > 0) {
130 // As the nodes are appended to item.fragment they are removed
131 // from item.element, so always use index 0.
132 orphanedFragment.appendChild(children[0]);
133 }
165 this._content.appendChild(orphanedFragment); 134 this._content.appendChild(orphanedFragment);
166 } 135 }
167 }, 136 },