From 9ae9a89a96431d0c7812d6611707beab57ddd5b8 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 21 Jul 2025 11:10:44 +0200 Subject: đŸ’„ import tables: vertical scroll buttons (#6400) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ishtar_common/static/js/ishtar.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'ishtar_common/static/js/ishtar.js') diff --git a/ishtar_common/static/js/ishtar.js b/ishtar_common/static/js/ishtar.js index d78cc3b12..bcc2b7940 100644 --- a/ishtar_common/static/js/ishtar.js +++ b/ishtar_common/static/js/ishtar.js @@ -39,6 +39,12 @@ if (typeof String.prototype.format !== 'function') { }; } +(function($) { + $.fn.hasHorizontalScrollBar = function() { + return this.get(0).scrollWidth > this.get(0).clientWidth; + } +})(jQuery); + $.urlParam = function(name){ var results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(window.location.href); if (results==null) { @@ -2252,3 +2258,24 @@ function load_window(url, speed, on_success, no_jump){ } }); } + +var display_horizontal_nav = function(div){ + if ($(div).hasHorizontalScrollBar()){ + $(".vscroll-arrows").show(); + } else { + $(".vscroll-arrows").hide(); + } +}; + +var register_vscroll_icons = function(){ + $("#vscroll-left").click(function(){ + let item = $(this).parent().parent(); + item.scrollLeft(0); + return false; + }); + $("#vscroll-right").click(function(){ + let item = $(this).parent().parent(); + item.scrollLeft(item.get(0).scrollWidth); + return false; + }); +}; -- cgit v1.2.3