From c19a0160a3006fb368785ba44736d662c542c3fc Mon Sep 17 00:00:00 2001 From: Os1r1s110 Date: Mon, 24 Feb 2020 15:12:32 -0500 Subject: [PATCH 1/3] Create scroller.label.xml --- docs/option/scroller.label.xml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 docs/option/scroller.label.xml diff --git a/docs/option/scroller.label.xml b/docs/option/scroller.label.xml new file mode 100644 index 0000000..61a546c --- /dev/null +++ b/docs/option/scroller.label.xml @@ -0,0 +1,32 @@ + + + scroller.label + Display a label while user is scrolling with the scrollbar + + + + * `true` show the label when scrolling + * `false` do not show + + + + + Label is displayed when scrolling using the scrollbar + + + + While scrolling using the scrollbar, a label is displayed to indicate the user the approximate position displayed within the whole dataset + + + + + From fb391789e21c16941b823a7284f69a2a592cd00d Mon Sep 17 00:00:00 2001 From: Os1r1s110 Date: Mon, 24 Feb 2020 15:18:25 -0500 Subject: [PATCH 2/3] Update dataTables.scroller.js --- js/dataTables.scroller.js | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/js/dataTables.scroller.js b/js/dataTables.scroller.js index fccf653..1693abb 100644 --- a/js/dataTables.scroller.js +++ b/js/dataTables.scroller.js @@ -490,7 +490,10 @@ $.extend( Scroller.prototype, { .append( this.dom.loader ); } - this.dom.label.appendTo(this.dom.scroller); + if ( this.s.label ) + { + this.dom.label.appendTo(this.dom.scroller); + } /* Initial size calculations */ if ( this.s.heights.row && this.s.heights.row != 'auto' ) @@ -521,8 +524,11 @@ $.extend( Scroller.prototype, { that.s.mousedown = true; }) .on('mouseup.dt-scroller', function () { - that.s.mouseup = false; - that.dom.label.css('display', 'none'); + that.s.mouseup = false; + if ( this.s.label ) + { + that.dom.label.css('display', 'none'); + } }); // On resize, update the information element, since the number of rows shown might change @@ -1062,7 +1068,7 @@ $.extend( Scroller.prototype, { this.s.lastScrollTop = iScrollTop; this.s.stateSaveThrottle(); - if ( this.s.scrollType === 'jump' && this.s.mousedown ) { + if ( this.s.scrollType === 'jump' && this.s.mousedown && this.s.label ) { this.dom.label .html( this.s.dt.fnFormatNumber( parseInt( this.s.topRowFloat, 10 )+1 ) ) .css( 'top', iScrollTop + (iScrollTop * heights.labelFactor ) ) @@ -1170,7 +1176,16 @@ Scroller.defaults = { * @default 200 * @static */ - serverWait: 200 + serverWait: 200, + + /** + * While scrolling using the scrollbar, a label is displayed to indicate the user + * the approximate position displayed within the whole table content + * @type bool + * @default true + * @static + */ + label: true }; Scroller.oDefaults = Scroller.defaults; From 027034fa428d79123a110a4225749a4207de278c Mon Sep 17 00:00:00 2001 From: Os1r1s110 Date: Mon, 24 Feb 2020 15:26:24 -0500 Subject: [PATCH 3/3] Update dataTables.scroller.js --- js/dataTables.scroller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/dataTables.scroller.js b/js/dataTables.scroller.js index 1693abb..a469abd 100644 --- a/js/dataTables.scroller.js +++ b/js/dataTables.scroller.js @@ -1,4 +1,4 @@ -/*! Scroller 2.0.1 +/*! Scroller 2.0.2 * ©2011-2019 SpryMedia Ltd - datatables.net/license */