diff options
Diffstat (limited to 'ishtar_common/static/js')
| -rw-r--r-- | ishtar_common/static/js/ishtar.js | 27 | 
1 files changed, 27 insertions, 0 deletions
| 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; +    }); +}; | 
