projects
/
Plinn.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
497dc01
)
Ajout méthodes getWindowScrollX, getWindowScrollY.
author
Benoît Pin
<pin@cri.ensmp.fr>
Thu, 10 Jul 2014 13:13:29 +0000
(15:13 +0200)
committer
Benoît Pin
<pin@cri.ensmp.fr>
Thu, 10 Jul 2014 13:13:29 +0000
(15:13 +0200)
skins/ajax_scripts/javascript_events_api.js
patch
|
blob
|
history
diff --git
a/skins/ajax_scripts/javascript_events_api.js
b/skins/ajax_scripts/javascript_events_api.js
index
94960c0
..
b4df40e
100644
(file)
--- a/
skins/ajax_scripts/javascript_events_api.js
+++ b/
skins/ajax_scripts/javascript_events_api.js
@@
-45,6
+45,8
@@
function buildMetaFunctions() {
disablePropagation = _build_disablePropagation();
getWindowWidth = _build_getWindowWidth();
getWindowHeight = _build_getWindowHeight();
disablePropagation = _build_disablePropagation();
getWindowWidth = _build_getWindowWidth();
getWindowHeight = _build_getWindowHeight();
+ getWindowScrollX = _build_getWindowScrollX();
+ getWindowScrollY = _build_getWindowScrollY();
clearSelection = _build_clearSelection();
}
clearSelection = _build_clearSelection();
}
@@
-210,6
+212,32
@@
function _build_getWindowHeight() {
}
}
}
}
+function _build_getWindowScrollX() {
+ if (window.scrollX !== undefined) {
+ return function(){
+ return window.scrollX;
+ };
+ }
+ else {
+ return function(){
+ return document.body.scrollLeft;
+ };
+ }
+}
+
+function _build_getWindowScrollY() {
+ if (window.scrollY !== undefined) {
+ return function(){
+ return window.scrollY;
+ };
+ }
+ else {
+ return function(){
+ return document.body.scrollTop;
+ };
+ }
+}
+
function _build_clearSelection() {
if (document.selection) {
return function() {
function _build_clearSelection() {
if (document.selection) {
return function() {