Index: elements/viewer-page-indicator/viewer-page-indicator.js |
diff --git a/elements/viewer-page-indicator/viewer-page-indicator.js b/elements/viewer-page-indicator/viewer-page-indicator.js |
index e22b5a6f91c496e2e3b2ee36080d10bff8527589..8612e170348f1894f46296e0dc5e2be93c984c33 100644 |
--- a/elements/viewer-page-indicator/viewer-page-indicator.js |
+++ b/elements/viewer-page-indicator/viewer-page-indicator.js |
@@ -3,8 +3,10 @@ |
// found in the LICENSE file. |
Polymer('viewer-page-indicator', { |
- text: '1', |
+ label: '1', |
+ index: 0, |
timerId: undefined, |
+ pageLabels: null, |
ready: function() { |
var callback = this.fadeIn.bind(this, 2000); |
window.addEventListener('scroll', function() { |
@@ -27,5 +29,14 @@ Polymer('viewer-page-indicator', { |
this.style.opacity = 0; |
this.timerId = undefined; |
}.bind(this), displayTime); |
+ }, |
+ pageLabelsChanged: function() { |
+ this.indexChanged(); |
+ }, |
+ indexChanged: function() { |
+ if (this.pageLabels) |
+ this.label = this.pageLabels[this.index]; |
+ else |
+ this.label = String(this.index + 1); |
} |
}); |