From 81bea17aefb26859f825b9293c7c99192874806e Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 8 Nov 2011 20:40:44 +0400 Subject: upgrade Dojo to 1.6.1 --- lib/dojo/dnd/autoscroll.js | 32 +++++++++----------------------- 1 file changed, 9 insertions(+), 23 deletions(-) (limited to 'lib/dojo/dnd/autoscroll.js') diff --git a/lib/dojo/dnd/autoscroll.js b/lib/dojo/dnd/autoscroll.js index 40daf66a1..d2c99cf30 100644 --- a/lib/dojo/dnd/autoscroll.js +++ b/lib/dojo/dnd/autoscroll.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 */ @@ -8,26 +8,11 @@ if(!dojo._hasResource["dojo.dnd.autoscroll"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. dojo._hasResource["dojo.dnd.autoscroll"] = true; dojo.provide("dojo.dnd.autoscroll"); +dojo.require("dojo.window"); -dojo.dnd.getViewport = function(){ - // summary: - // Returns a viewport size (visible part of the window) - - // TODO: remove this when getViewport() moved to dojo core, see #7028 +dojo.getObject("dnd", true, dojo); - // FIXME: need more docs!! - var d = dojo.doc, dd = d.documentElement, w = window, b = dojo.body(); - if(dojo.isMozilla){ - return {w: dd.clientWidth, h: w.innerHeight}; // Object - }else if(!dojo.isOpera && w.innerWidth){ - return {w: w.innerWidth, h: w.innerHeight}; // Object - }else if (!dojo.isOpera && dd && dd.clientWidth){ - return {w: dd.clientWidth, h: dd.clientHeight}; // Object - }else if (b.clientWidth){ - return {w: b.clientWidth, h: b.clientHeight}; // Object - } - return null; // Object -}; +dojo.dnd.getViewport = dojo.window.getBox; dojo.dnd.V_TRIGGER_AUTOSCROLL = 32; dojo.dnd.H_TRIGGER_AUTOSCROLL = 32; @@ -43,7 +28,7 @@ dojo.dnd.autoScroll = function(e){ // onmousemove event // FIXME: needs more docs! - var v = dojo.dnd.getViewport(), dx = 0, dy = 0; + var v = dojo.window.getBox(), dx = 0, dy = 0; if(e.clientX < dojo.dnd.H_TRIGGER_AUTOSCROLL){ dx = -dojo.dnd.H_AUTOSCROLL_VALUE; }else if(e.clientX > v.w - dojo.dnd.H_TRIGGER_AUTOSCROLL){ @@ -74,14 +59,15 @@ dojo.dnd.autoScrollNodes = function(e){ if(s.overflow.toLowerCase() in dojo.dnd._validOverflow){ var b = dojo._getContentBox(n, s), t = dojo.position(n, true); //console.log(b.l, b.t, t.x, t.y, n.scrollLeft, n.scrollTop); - var w = Math.min(dojo.dnd.H_TRIGGER_AUTOSCROLL, b.w / 2), + var w = Math.min(dojo.dnd.H_TRIGGER_AUTOSCROLL, b.w / 2), h = Math.min(dojo.dnd.V_TRIGGER_AUTOSCROLL, b.h / 2), rx = e.pageX - t.x, ry = e.pageY - t.y, dx = 0, dy = 0; if(dojo.isWebKit || dojo.isOpera){ - // FIXME: this code should not be here, it should be taken into account + // FIXME: this code should not be here, it should be taken into account // either by the event fixing code, or the dojo.position() // FIXME: this code doesn't work on Opera 9.5 Beta - rx += dojo.body().scrollLeft, ry += dojo.body().scrollTop; + rx += dojo.body().scrollLeft; + ry += dojo.body().scrollTop; } if(rx > 0 && rx < b.w){ if(rx < w){ -- cgit v1.2.3