aboutsummaryrefslogtreecommitdiff
path: root/node_modules/montage/ui/scroll.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/montage/ui/scroll.js')
-rwxr-xr-xnode_modules/montage/ui/scroll.js1634
1 files changed, 814 insertions, 820 deletions
diff --git a/node_modules/montage/ui/scroll.js b/node_modules/montage/ui/scroll.js
index f59ff9bb..3126ae1c 100755
--- a/node_modules/montage/ui/scroll.js
+++ b/node_modules/montage/ui/scroll.js
@@ -1,820 +1,814 @@
1/* <copyright> 1var Montage = require("montage").Montage,
2This file contains proprietary software owned by Motorola Mobility, Inc.<br/> 2 defaultEventManager = require("core/event/event-manager").defaultEventManager;
3No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> 3
4(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. 4var Scroll = exports.Scroll = Montage.create(Montage, {
5</copyright> */ 5
6 6 _externalUpdate: {
7var Montage = require("montage").Montage, 7 enumerable: false,
8 defaultEventManager = require("core/event/event-manager").defaultEventManager; 8 value: true
9 9 },
10var Scroll = exports.Scroll = Montage.create(Montage, { 10
11 11 isAnimating: {
12 _externalUpdate: { 12 enumerable: false,
13 enumerable: false, 13 value: false
14 value: true 14 },
15 }, 15
16 16 component: {
17 isAnimating: { 17 value: {}
18 enumerable: false, 18 },
19 value: false 19
20 }, 20 _needsDraw: {
21 21 enumerable: false,
22 component: { 22 value: false
23 value: {} 23 },
24 }, 24
25 25 needsDraw: {
26 _needsDraw: { 26 get: function () {
27 enumerable: false, 27 return this._needsDraw;
28 value: false 28 },
29 }, 29 set: function (value) {
30 30 this._needsDraw = value;
31 needsDraw: { 31 if (this.component) {
32 get: function () { 32 this.component.needsDraw = true;
33 return this._needsDraw; 33 }
34 }, 34 }
35 set: function (value) { 35 },
36 this._needsDraw = value; 36
37 if (this.component) { 37 draw: {
38 this.component.needsDraw = true; 38 value: function () {
39 } 39 this._needsDraw = false;
40 } 40 if (this.isAnimating) {
41 }, 41 this._animationInterval();
42 42 }
43 draw: { 43 this._externalUpdate = false;
44 value: function () { 44 }
45 this._needsDraw = false; 45 },
46 if (this.isAnimating) { 46
47 this._animationInterval(); 47 deserializedFromTemplate: {
48 } 48 value: function () {
49 this._externalUpdate = false; 49 var oldComponentDraw = this.component.draw,
50 } 50 self = this;
51 }, 51
52 52 this.component.draw = function () {
53 deserializedFromTemplate: { 53 self.draw();
54 value: function () { 54 oldComponentDraw.call(self.component);
55 var oldComponentDraw = this.component.draw, 55 };
56 self = this; 56 }
57 57 },
58 this.component.draw = function () { 58
59 self.draw(); 59 _pointerSpeedMultiplier: {
60 oldComponentDraw.call(self.component); 60 enumerable: false,
61 }; 61 value: 1
62 } 62 },
63 }, 63
64 64 pointerSpeedMultiplier: {
65 _pointerSpeedMultiplier: { 65 get: function () {
66 enumerable: false, 66 return this._pointerSpeedMultiplier;
67 value: 1 67 },
68 }, 68 set: function (value) {
69 69 this._pointerSpeedMultiplier = value;
70 pointerSpeedMultiplier: { 70 }
71 get: function () { 71 },
72 return this._pointerSpeedMultiplier; 72
73 }, 73 pointerStartEventPosition: {
74 set: function (value) { 74 value: null
75 this._pointerSpeedMultiplier = value; 75 },
76 } 76
77 }, 77 _isSelfUpdate: {
78 78 enumerable: false,
79 pointerStartEventPosition: { 79 value: false
80 value: null 80 },
81 }, 81
82 82 _scrollX: {
83 _isSelfUpdate: { 83 enumerable: false,
84 enumerable: false, 84 value: 0
85 value: false 85 },
86 }, 86
87 87 scrollX: {
88 _scrollX: { 88 get: function () {
89 enumerable: false, 89 return this._scrollX;
90 value: 0 90 },
91 }, 91 set: function (value) {
92 92 if (this._axis==="vertical") {
93 scrollX: { 93 this._scrollX=0;
94 get: function () { 94 } else {
95 return this._scrollX; 95 var tmp=isNaN(value)?0:value>>0;
96 }, 96
97 set: function (value) { 97 if ((!this._hasBouncing)||(!this._isSelfUpdate)) {
98 if (this._axis==="vertical") { 98 if (tmp<0) {
99 this._scrollX=0; 99 tmp=0;
100 } else { 100 }
101 var tmp=isNaN(value)?0:value>>0; 101 if (tmp>this._maxScrollX) {
102 102 tmp=this._maxScrollX;
103 if ((!this._hasBouncing)||(!this._isSelfUpdate)) { 103 }
104 if (tmp<0) { 104 if (!this._isSelfUpdate) {
105 tmp=0; 105 this.isAnimating = false;
106 } 106 }
107 if (tmp>this._maxScrollX) { 107 }
108 tmp=this._maxScrollX; 108 this._scrollX=tmp;
109 } 109 }
110 if (!this._isSelfUpdate) { 110 }
111 this.isAnimating = false; 111 },
112 } 112
113 } 113 _scrollY: {
114 this._scrollX=tmp; 114 enumerable: false,
115 } 115 value: 0
116 } 116 },
117 }, 117
118 118 scrollY: {
119 _scrollY: { 119 get: function () {
120 enumerable: false, 120 return this._scrollY;
121 value: 0 121 },
122 }, 122 set: function (value) {
123 123 if (this._axis==="horizontal") {
124 scrollY: { 124 this._scrollY=0;
125 get: function () { 125 } else {
126 return this._scrollY; 126 var tmp=isNaN(value)?0:value>>0;
127 }, 127
128 set: function (value) { 128 if ((!this._hasBouncing)||(!this._isSelfUpdate)) {
129 if (this._axis==="horizontal") { 129 if (tmp<0) {
130 this._scrollY=0; 130 tmp=0;
131 } else { 131 }
132 var tmp=isNaN(value)?0:value>>0; 132 if (tmp>this._maxScrollY) {
133 133 tmp=this._maxScrollY;
134 if ((!this._hasBouncing)||(!this._isSelfUpdate)) { 134 }
135 if (tmp<0) { 135 if (!this._isSelfUpdate) {
136 tmp=0; 136 this.isAnimating = false;
137 } 137 }
138 if (tmp>this._maxScrollY) { 138 }
139 tmp=this._maxScrollY; 139 this._scrollY=tmp;
140 } 140 }
141 if (!this._isSelfUpdate) { 141 }
142 this.isAnimating = false; 142 },
143 } 143
144 } 144 _maxScrollX: {
145 this._scrollY=tmp; 145 enumerable: false,
146 } 146 value: 0
147 } 147 },
148 }, 148
149 149 maxScrollX: {
150 _maxScrollX: { 150 get: function () {
151 enumerable: false, 151 return this._maxScrollX;
152 value: 0 152 },
153 }, 153 set: function (value) {
154 154 var tmp=isNaN(value)?0:value>>0;
155 maxScrollX: { 155
156 get: function () { 156 if (tmp<0) {
157 return this._maxScrollX; 157 tmp=0;
158 },