From 2e32b5f467e9bb66e339c56308ad8a82163566e6 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 15 Jul 2016 13:20:00 +0200 Subject: upgrade to jquery-3.1 and minor fixes --- view/js/main.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'view/js/main.js') diff --git a/view/js/main.js b/view/js/main.js index 2caf5a1dd..90ca92078 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -283,12 +283,13 @@ $(function() { /* Turn elements with one of our special rel tags into popup menus */ /* CHANGES: let bootstrap handle popups and only do the loading here */ - $('a[rel^=#]').click(function(e){ + + $('a[rel^="#"]').click(function(e){ manage_popup_menu(this, e); return; }); - $('span[rel^=#]').click(function(e){ + $('span[rel^="#"]').click(function(e){ manage_popup_menu(this, e); return; }); @@ -679,8 +680,8 @@ function collapseHeight() { speed: 0, heightMargin: 50, collapsedHeight: divmore_height, - moreLink: '' + aStr.divgrowmore + '', - lessLink: '' + aStr.divgrowless + '', + moreLink: '' + aStr.divgrowmore + '', + lessLink: '' + aStr.divgrowless + '', beforeToggle: function(trigger, element, expanded) { if(expanded) { if((($(element).offset().top + divmore_height) - $(window).scrollTop()) < 65 ) { -- cgit v1.2.3 From 9048f8cffea94b653e97bed421e2be10c9c6a7d3 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 15 Jul 2016 14:53:15 +0200 Subject: bump minor version because of jquery update --- view/js/main.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'view/js/main.js') diff --git a/view/js/main.js b/view/js/main.js index 90ca92078..8280d2ddb 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -653,7 +653,7 @@ function updateConvItems(mode,data) { } function collapseHeight() { - var origContentHeight = parseInt($("#region_2").height()); + var origContentHeight = Math.ceil($("#region_2").height()); var cDiff = 0; var i = 0; var position = $(window).scrollTop(); @@ -663,19 +663,13 @@ function collapseHeight() { if(orgHeight > divmore_height) { if(! $(this).hasClass('divmore')) { - //var trigger = $(window).scrollTop() < $(this).offset().top ? true : false; - //console.log($(this).offset().top + divmore_height - $(window).scrollTop() + cDiff - ($(".divgrow-showmore").outerHeight() * i)); - // check if we will collapse some content above the visible content and compensate the diff later if($(this).offset().top + divmore_height - $(window).scrollTop() + cDiff - ($(".divgrow-showmore").outerHeight() * i) < 65) { - //$(this).css('color', 'red'); - //console.log($(this).offset().top + divmore_height + ' / ' + $(window).scrollTop()); diff = orgHeight - divmore_height; cDiff = cDiff + diff; i++; } - //if(trigger) { $(this).readmore({ speed: 0, heightMargin: 50, @@ -691,12 +685,11 @@ function collapseHeight() { } }); $(this).addClass('divmore'); - //} } } }); - var collapsedContentHeight = parseInt($("#region_2").height()); + var collapsedContentHeight = Math.ceil($("#region_2").height()); contentHeightDiff = origContentHeight - collapsedContentHeight; console.log('collapseHeight() - contentHeightDiff: ' + contentHeightDiff + 'px'); -- cgit v1.2.3