aboutsummaryrefslogtreecommitdiff
path: root/includes/js/dijit/_base/scroll.js
diff options
context:
space:
mode:
authormensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-11-13 09:49:11 +0000
committermensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-11-13 09:49:11 +0000
commite44a7e37b6c7b5961adaffc62b9042b8d442938e (patch)
tree95b67c356e93163467db2451f2b8cce84ed5d582 /includes/js/dijit/_base/scroll.js
parenta62b9742ee5e28bcec6872d88f50f25b820914f6 (diff)
downloadsemanticscuttle-e44a7e37b6c7b5961adaffc62b9042b8d442938e.tar.gz
semanticscuttle-e44a7e37b6c7b5961adaffc62b9042b8d442938e.tar.bz2
New feature: basic Ajax suggestion for tags and implementation of Dojo toolkit
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@151 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'includes/js/dijit/_base/scroll.js')
-rw-r--r--includes/js/dijit/_base/scroll.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/includes/js/dijit/_base/scroll.js b/includes/js/dijit/_base/scroll.js
new file mode 100644
index 0000000..2aeac5a
--- /dev/null
+++ b/includes/js/dijit/_base/scroll.js
@@ -0,0 +1,29 @@
+if(!dojo._hasResource["dijit._base.scroll"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
+dojo._hasResource["dijit._base.scroll"] = true;
+dojo.provide("dijit._base.scroll");
+
+dijit.scrollIntoView = function(/* DomNode */node){
+ // summary
+ // Scroll the passed node into view, if it is not.
+
+ // don't rely on that node.scrollIntoView works just because the function is there
+ // it doesnt work in Konqueror or Opera even though the function is there and probably
+ // not safari either
+ // native scrollIntoView() causes FF3's whole window to scroll if there is no scroll bar
+ // on the immediate parent
+ // dont like browser sniffs implementations but sometimes you have to use it
+ // #6146: IE scrollIntoView is broken
+ // It's not enough just to scroll the menu node into view if
+ // node.scrollIntoView hides part of the parent's scrollbar,
+ // so just manage the parent scrollbar ourselves
+ var parent = node.parentNode;
+ var parentBottom = parent.scrollTop + dojo.marginBox(parent).h; //PORT was getBorderBox
+ var nodeBottom = node.offsetTop + dojo.marginBox(node).h;
+ if(parentBottom < nodeBottom){
+ parent.scrollTop += (nodeBottom - parentBottom);
+ }else if(parent.scrollTop > node.offsetTop){
+ parent.scrollTop -= (parent.scrollTop - node.offsetTop);
+ }
+};
+
+}