summaryrefslogtreecommitdiff
path: root/lib/dojo/window.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2011-11-08 20:40:44 +0400
committerAndrew Dolgov <[email protected]>2011-11-08 20:40:44 +0400
commit81bea17aefb26859f825b9293c7c99192874806e (patch)
treefb244408ca271affa2899adb634788802c9a89d8 /lib/dojo/window.js
parent870a70e109ac9e80a88047044530de53d0404ec7 (diff)
upgrade Dojo to 1.6.1
Diffstat (limited to 'lib/dojo/window.js')
-rw-r--r--lib/dojo/window.js18
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/dojo/window.js b/lib/dojo/window.js
index c36eb4c23..4e363faba 100644
--- a/lib/dojo/window.js
+++ b/lib/dojo/window.js
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
+ Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details
*/
@@ -9,6 +9,8 @@ if(!dojo._hasResource["dojo.window"]){ //_hasResource checks added by build. Do
dojo._hasResource["dojo.window"] = true;
dojo.provide("dojo.window");
+dojo.getObject("window", true, dojo);
+
dojo.window.getBox = function(){
// summary:
// Returns the dimensions and scroll position of the viewable area of a browser window
@@ -62,7 +64,9 @@ dojo.window.scrollIntoView = function(/*DomNode*/ node, /*Object?*/ pos){
return;
}
var backCompat = doc.compatMode == 'BackCompat',
- clientAreaRoot = backCompat? body : html,
+ clientAreaRoot = (isIE >= 9 && node.ownerDocument.parentWindow.frameElement)
+ ? ((html.clientHeight > 0 && html.clientWidth > 0 && (body.clientHeight == 0 || body.clientWidth == 0 || body.clientHeight > html.clientHeight || body.clientWidth > html.clientWidth)) ? html : body)
+ : (backCompat ? body : html),
scrollRoot = isWK ? body : clientAreaRoot,
rootWidth = clientAreaRoot.clientWidth,
rootHeight = clientAreaRoot.clientHeight,
@@ -87,14 +91,11 @@ dojo.window.scrollIntoView = function(/*DomNode*/ node, /*Object?*/ pos){
}else{
var pb = dojo._getPadBorderExtents(el);
elPos.w -= pb.w; elPos.h -= pb.h; elPos.x += pb.l; elPos.y += pb.t;
- }
-
- if(el != scrollRoot){ // body, html sizes already have the scrollbar removed
var clientSize = el.clientWidth,
scrollBarSize = elPos.w - clientSize;
if(clientSize > 0 && scrollBarSize > 0){
elPos.w = clientSize;
- if(isIE && rtl){ elPos.x += scrollBarSize; }
+ elPos.x += (rtl && (isIE || el.clientLeft > pb.l/*Chrome*/)) ? scrollBarSize : 0;
}
clientSize = el.clientHeight;
scrollBarSize = elPos.h - clientSize;
@@ -123,8 +124,9 @@ dojo.window.scrollIntoView = function(/*DomNode*/ node, /*Object?*/ pos){
bot = t + nodePos.h - elPos.h; // beyond bottom: > 0
if(r * l > 0){
var s = Math[l < 0? "max" : "min"](l, r);
+ if(rtl && ((isIE == 8 && !backCompat) || isIE >= 9)){ s = -s; }
nodePos.x += el.scrollLeft;
- el.scrollLeft += (isIE >= 8 && !backCompat && rtl)? -s : s;
+ el.scrollLeft += s;
nodePos.x -= el.scrollLeft;
}
if(bot * t > 0){
@@ -133,7 +135,7 @@ dojo.window.scrollIntoView = function(/*DomNode*/ node, /*Object?*/ pos){
nodePos.y -= el.scrollTop;
}
el = (el != scrollRoot) && !fixedPos && el.parentNode;
- }
+ }
}catch(error){
console.error('scrollIntoView: ' + error);
node.scrollIntoView(false);