diff options
author | Paolo T <tuscanhobbit@users.noreply.github.com> | 2013-10-25 00:09:42 -0700 |
---|---|---|
committer | Paolo T <tuscanhobbit@users.noreply.github.com> | 2013-10-25 00:09:42 -0700 |
commit | b23f3fc03b6bc751aab67fe2258a21f7c65bab8e (patch) | |
tree | 84c997aa781afa566536ca5f66eb8f90ef468476 /js | |
parent | d30f718e0836a031e43d5403480aa049561e736e (diff) | |
parent | 0b0bd3c20765d267ec6d7cc261c7713917a22582 (diff) | |
download | volse-hubzilla-b23f3fc03b6bc751aab67fe2258a21f7c65bab8e.tar.gz volse-hubzilla-b23f3fc03b6bc751aab67fe2258a21f7c65bab8e.tar.bz2 volse-hubzilla-b23f3fc03b6bc751aab67fe2258a21f7c65bab8e.zip |
Merge pull request #3 from friendica/master
Align to main project HEAD
Diffstat (limited to 'js')
-rw-r--r-- | js/ajaxupload.js | 53 | ||||
-rw-r--r-- | js/main.js | 8 |
2 files changed, 45 insertions, 16 deletions
diff --git a/js/ajaxupload.js b/js/ajaxupload.js index 67c4a56fb..5719f30e0 100644 --- a/js/ajaxupload.js +++ b/js/ajaxupload.js @@ -58,6 +58,25 @@ }); } + // Get offset adding all offsets, slow fall-back method + var getOffsetSlow = function(el){ + var top = 0, left = 0; + do { + top += el.offsetTop || 0; + left += el.offsetLeft || 0; + el = el.offsetParent; + } while (el); + + return { + left: left, + top: top + }; + }; + + + + + // Needs more testing, will be rewriten for next version // getOffset function copied from jQuery lib (http://jquery.com/) if (document.documentElement.getBoundingClientRect){ @@ -78,7 +97,12 @@ var bound = body.getBoundingClientRect(); zoom = (bound.right - bound.left) / body.clientWidth; } - + + // some CSS layouts gives 0 width and/or bounding boxes + // in this case we fall back to the slow method + if (zoom == 0 || body.clientWidth == 0) + return getOffsetSlow(el); + if (zoom > 1) { clientTop = 0; clientLeft = 0; @@ -92,20 +116,21 @@ }; }; } else { - // Get offset adding all offsets - var getOffset = function(el){ - var top = 0, left = 0; - do { - top += el.offsetTop || 0; - left += el.offsetLeft || 0; - el = el.offsetParent; - } while (el); +// // Get offset adding all offsets + // var getOffset = function(el){ + // var top = 0, left = 0; + // do { + // top += el.offsetTop || 0; + // left += el.offsetLeft || 0; + // el = el.offsetParent; + // } while (el); - return { - left: left, - top: top - }; - }; + // return { + // left: left, + // top: top + // }; + // }; + var getOffset = getOffsetSlowl } /** diff --git a/js/main.js b/js/main.js index d5260a4be..79f11f424 100644 --- a/js/main.js +++ b/js/main.js @@ -98,6 +98,7 @@ function markRead(notifType) { $.get('ping?f=&markRead='+notifType); if(timer) clearTimeout(timer); + $('#' + notifType + '-update').html(''); timer = setTimeout(NavUpdate,2000); } @@ -137,7 +138,9 @@ e.tipTip({defaultPosition: pos, edgeOffset: 8}); });*/ - + var e = document.getElementById('content-complete'); + if(e) + pageHasMoreContent = false; /* setup onoff widgets */ $(".onoff input").each(function(){ @@ -573,7 +576,8 @@ function updateConvItems(mode,data) { updateConvItems(update_mode,data); $("#page-spinner").spin(false); $("#profile-jot-text-loading").spin(false); - + if(timer) clearTimeout(timer); + timer = setTimeout(NavUpdate,10); }); |