* @class Roo.bootstrap.DocumentSlider
* @extends Roo.bootstrap.Component
* Bootstrap DocumentSlider class
- * @cfg {Number} total
*
* @constructor
* Create a new DocumentViewer
* Fire after update
* @param {Roo.bootstrap.DocumentSlider} this
*/
- "update" : true
+ "update" : true,
+ /**
+ * @event click
+ * Fire after click
+ * @param {Roo.bootstrap.DocumentSlider} this
+ */
+ "click" : true
});
};
this.nextIndicator = this.el.select('.roo-document-slider-next i', true).first();
this.nextIndicator.setVisibilityMode(Roo.Element.DISPLAY);
+ this.thumbEl.on('click', this.onClick, this);
+
this.prevIndicator.on('click', this.prev, this);
this.nextIndicator.on('click', this.next, this);
this.titleEl.dom.innerHTML = String.format('{0} / {1}', this.indicator, this.files.length);
+ this.prevIndicator.show();
+
if(this.indicator == 1){
this.prevIndicator.hide();
}
+ this.nextIndicator.show();
+
if(this.indicator == this.files.length){
this.nextIndicator.hide();
}
this.fireEvent('update', this);
},
- prev : function()
+ onClick : function(e)
{
- this.indicator = Math.min(1, this.indicator - 1);
+ e.preventDefault();
+
+ this.fireEvent('click', this);
+ },
+
+ prev : function(e)
+ {
+ e.preventDefault();
+
+ this.indicator = Math.max(1, this.indicator - 1);
this.update();
},
- next : function()
+ next : function(e)
{
+ e.preventDefault();
+
this.indicator = Math.min(this.files.length, this.indicator + 1);
this.update();