summaryrefslogtreecommitdiff
path: root/ishtar_common/static/js/ishtar.js
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common/static/js/ishtar.js')
-rw-r--r--ishtar_common/static/js/ishtar.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/ishtar_common/static/js/ishtar.js b/ishtar_common/static/js/ishtar.js
index 1ef2e4c1d..0be326aae 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) {
@@ -2228,3 +2234,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;
+ });
+};