aboutsummaryrefslogtreecommitdiff
path: root/node_modules/montage/ui/scroller.reel
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
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')
-rw-r--r--node_modules/montage/ui/scroller.reel/scroller.html56
-rw-r--r--node_modules/montage/ui/scroller.reel/scroller.js49
2 files changed, 22 insertions, 83 deletions
diff --git a/node_modules/montage/ui/scroller.reel/scroller.html b/node_modules/montage/ui/scroller.reel/scroller.html
index 656db110..fc59297f 100644
--- a/node_modules/montage/ui/scroller.reel/scroller.html
+++ b/node_modules/montage/ui/scroller.reel/scroller.html
@@ -7,8 +7,8 @@
7<html> 7<html>
8 <head> 8 <head>
9 <title></title> 9 <title></title>
10 <script type="text/montage-serialization"> 10 <script type="text/montage-serialization">{
11 { 11
12 "scrollbars": { 12 "scrollbars": {
13 "module": "montage/ui/scroll-bars.reel", 13 "module": "montage/ui/scroll-bars.reel",
14 "name": "ScrollBars", 14 "name": "ScrollBars",
@@ -22,47 +22,17 @@
22 "module": "montage/ui/composer/translate-composer", 22 "module": "montage/ui/composer/translate-composer",
23 "name": "TranslateComposer", 23 "name": "TranslateComposer",
24 "properties": { 24 "properties": {
25 "component": {"@": "owner"} 25 "component": {"@": "owner"},
26 "invertAxis": true
26 }, 27 },
27 "bindings": { 28 "bindings": {
28 "translateX": { 29 "translateX": {"<<->": "@owner.scrollX"},
29 "boundObject": {"@": "owner"}, 30 "translateY": {"<<->": "@owner.scrollY"},
30 "boundObjectPropertyPath": "scrollX", 31 "maxTranslateY": {"<<->": "@owner._maxTranslateY"},
31 "oneway": false 32 "maxTranslateX": {"<<->": "@owner._maxTranslateX"},
32 }, 33 "axis": {"<<->": "@owner.axis"},
33 "translateY": { 34 "hasBouncing": {"<<->": "@owner.hasBouncing"},
34 "boundObject": {"@": "owner"}, 35 "hasMomentum": {"<<->": "@owner.hasMomentum"}
35 "boundObjectPropertyPath": "scrollY",
36 "oneway": false
37 },
38 "maxTranslateY": {
39 "boundObject": {"@": "owner"},
40 "boundObjectPropertyPath": "_maxTranslateY"
41 },
42 "maxTranslateX": {
43 "boundObject": {"@": "owner"},
44 "boundObjectPropertyPath": "_maxTranslateX"
45 },
46 "axis": {
47 "boundObject": {"@": "owner"},
48 "boundObjectPropertyPath": "axis"
49 },
50 "hasBouncing": {
51 "boundObject": {"@": "owner"},
52 "boundObjectPropertyPath": "hasBouncing"
53 },
54 "hasMomentum": {
55 "boundObject": {"@": "owner"},
56 "boundObjectPropertyPath": "hasMomentum"
57 },
58 "bouncingDuration": {
59 "boundObject": {"@": "owner"},
60 "boundObjectPropertyPath": "bouncingDuration"
61 },
62 "momentumDuration": {
63 "boundObject": {"@": "owner"},
64 "boundObjectPropertyPath": "momentumDuration"
65 }
66 }, 36 },
67 "listeners": [ 37 "listeners": [
68 { 38 {
@@ -90,8 +60,8 @@
90 } 60 }
91 } 61 }
92 } 62 }
93 } 63
94 </script> 64 }</script>
95 <style> 65 <style>
96 .montage-scroller { 66 .montage-scroller {
97 position: relative; 67 position: relative;
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 },