diff options
author | Andrew Manning <tamanning@zoho.com> | 2016-07-20 05:39:08 -0400 |
---|---|---|
committer | Andrew Manning <tamanning@zoho.com> | 2016-07-20 05:39:08 -0400 |
commit | e0d9d30bcf3b3b8f08bebc3ea6a8bbd20416f272 (patch) | |
tree | 27bd2e18dddc900edc39f34b47bfea749b3dcf61 /view/js/main.js | |
parent | 50e581d88ad4901b13bbf99b2e58a5787b6bccec (diff) | |
parent | 9421e42dad0bee6e0aa292d390cf249e1d7f7df4 (diff) | |
download | volse-hubzilla-e0d9d30bcf3b3b8f08bebc3ea6a8bbd20416f272.tar.gz volse-hubzilla-e0d9d30bcf3b3b8f08bebc3ea6a8bbd20416f272.tar.bz2 volse-hubzilla-e0d9d30bcf3b3b8f08bebc3ea6a8bbd20416f272.zip |
Merge remote-tracking branch 'upstream/dev' into wiki
Diffstat (limited to 'view/js/main.js')
-rw-r--r-- | view/js/main.js | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/view/js/main.js b/view/js/main.js index 2caf5a1dd..a288f98f5 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; }); @@ -639,7 +640,7 @@ function updateConvItems(mode,data) { var bimgcount = bimgs.length; if (bimgcount) { - bimgs.load(function() { + bimgs.on('load',function() { bimgcount--; if (! bimgcount) { collapseHeight(); @@ -652,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(); @@ -662,25 +663,19 @@ 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, collapsedHeight: divmore_height, - moreLink: '<a href="#" class="divgrow-showmore">' + aStr.divgrowmore + '</a>', - lessLink: '<a href="#" class="divgrow-showmore">' + aStr.divgrowless + '</a>', + moreLink: '<a href="#" class="divgrow-showmore fakelink">' + aStr.divgrowmore + '</a>', + lessLink: '<a href="#" class="divgrow-showmore fakelink">' + aStr.divgrowless + '</a>', beforeToggle: function(trigger, element, expanded) { if(expanded) { if((($(element).offset().top + divmore_height) - $(window).scrollTop()) < 65 ) { @@ -690,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'); |