diff options
author | Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> | 2019-01-23 14:43:45 +0200 |
---|---|---|
committer | Olivier Hallot <olivier.hallot@libreoffice.org> | 2019-01-23 15:03:51 +0100 |
commit | b3686d53d10873b1260091a4c6a898575516217e (patch) | |
tree | ddb545254b112961e21af492b639882fa2a35b9f /help3xsl/paginathing.js | |
parent | de5dad498afaadc2308ee247f26aa6f9b14a3d66 (diff) |
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 <olivier.hallot@libreoffice.org>
Diffstat (limited to 'help3xsl/paginathing.js')
-rw-r--r-- | help3xsl/paginathing.js | 13 |
1 files 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); } |