projects
/
blerg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add OldSchoolSpinner for loading animation
[blerg.git]
/
www
/
jssrc
/
blerg
/
Pager.js
diff --git
a/www/jssrc/blerg/Pager.js
b/www/jssrc/blerg/Pager.js
index
2e27177
..
92f6f4c
100644
(file)
--- a/
www/jssrc/blerg/Pager.js
+++ b/
www/jssrc/blerg/Pager.js
@@
-4,7
+4,8
@@
enyo.kind({
listKind: "Control",
lastRecord: null,
components: [
listKind: "Control",
lastRecord: null,
components: [
- {name: "records"}
+ {name: "records"},
+ {name: "spinner", kind: "OldSchoolSpinner", showing: false}
],
addItems: function(items) {
this.$.records.createComponents(items, {kind: this.listKind});
],
addItems: function(items) {
this.$.records.createComponents(items, {kind: this.listKind});
@@
-14,6
+15,7
@@
enyo.kind({
this.lastRecord = r;
}
this.$.records.render();
this.lastRecord = r;
}
this.$.records.render();
+ this.stopLoadAnimation();
},
loadMore: function() {
if (this.lastRecord == 0)
},
loadMore: function() {
if (this.lastRecord == 0)
@@
-29,5
+31,15
@@
enyo.kind({
this.loadItems();
}
},
this.loadItems();
}
},
- loadItems: function(from, to) { }
+ loadItems: function(from, to) {
+ this.startLoadAnimation();
+ },
+ startLoadAnimation: function() {
+ this.$.spinner.show();
+ this.$.spinner.start();
+ },
+ stopLoadAnimation: function() {
+ this.$.spinner.hide();
+ this.$.spinner.stop();
+ }
});
});