X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;f=www%2Fjssrc%2Fblerg%2FPager.js;h=f311d1f60a7a4e92a947ee2699766d3638ec63cd;hb=4210d2d20df6635e19c20f5b303d498f4657968b;hp=92f6f4cc4a14377b22966a402b096e2da73b00e5;hpb=782bdd9400ccdef901463f1bb5788c31275cd007;p=blerg.git diff --git a/www/jssrc/blerg/Pager.js b/www/jssrc/blerg/Pager.js index 92f6f4c..f311d1f 100644 --- a/www/jssrc/blerg/Pager.js +++ b/www/jssrc/blerg/Pager.js @@ -8,11 +8,15 @@ enyo.kind({ {name: "spinner", kind: "OldSchoolSpinner", showing: false} ], addItems: function(items) { - this.$.records.createComponents(items, {kind: this.listKind}); - for (var i = 0; i < items.length; i++) { - var r = parseInt(items[i].record); - if (r < this.lastRecord || this.lastRecord == null) - this.lastRecord = r; + if (items.length > 0) { + this.$.records.createComponents(items, {kind: this.listKind}); + for (var i = 0; i < items.length; i++) { + var r = parseInt(items[i].record); + if (r < this.lastRecord || this.lastRecord == null) + this.lastRecord = r; + } + } else { + this.$.records.createComponent({content: "No items"}); } this.$.records.render(); this.stopLoadAnimation();