From aa7a881b0cddfab63d3fdfe3904f8a70200b8ad7 Mon Sep 17 00:00:00 2001 From: Ilmari Lauhakangas Date: Wed, 23 Jan 2019 14:43:45 +0200 Subject: Moved the pagination controls to the top As the height of the result list keeps changing constantly, it was highly annoying to click the arrows in the controls. Change-Id: I82308adc3971f25ed629009bf1e0854d38197560 Reviewed-on: https://gerrit.libreoffice.org/66795 Tested-by: Jenkins Reviewed-by: Olivier Hallot (cherry picked from commit b3686d53d10873b1260091a4c6a898575516217e) Reviewed-on: https://gerrit.libreoffice.org/68522 Reviewed-by: Adolfo Jayme Barrientos --- help3xsl/paginathing.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/help3xsl/paginathing.js b/help3xsl/paginathing.js index 2f3636022f..81edf3e0d8 100644 --- a/help3xsl/paginathing.js +++ b/help3xsl/paginathing.js @@ -29,17 +29,18 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -// Polyfill for .after() +// Polyfill for .before() +// from: https://github.com/jserz/js_piece/blob/master/DOM/ChildNode/before()/before().md (function (arr) { arr.forEach(function (item) { - if (item.hasOwnProperty('after')) { + if (item.hasOwnProperty('before')) { return; } - Object.defineProperty(item, 'after', { + Object.defineProperty(item, 'before', { configurable: true, enumerable: true, writable: true, - value: function after() { + value: function before() { var argArr = Array.prototype.slice.call(arguments), docFrag = document.createDocumentFragment(); @@ -48,7 +49,7 @@ docFrag.appendChild(isNode ? argItem : document.createTextNode(String(argItem))); }); - this.parentNode.insertBefore(docFrag, this.nextSibling); + this.parentNode.insertBefore(docFrag, this); } }); }); @@ -229,7 +230,7 @@ var Paginator = function(element) { } } - el.after(container); + el.before(container); container.appendChild(ul); } -- cgit