aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorEduardo Lundgren <eduardolundgren@gmail.com>2008-11-21 18:41:19 +0000
committerEduardo Lundgren <eduardolundgren@gmail.com>2008-11-21 18:41:19 +0000
commit6a621b6d0e9b60ec75352429a3d1015989a0bd78 (patch)
tree2aae306e6cb6c7eb36afb76598e82770f5732e6d /ui
parent89793957e5df2ec64a2aa63b0d0ecdded791cf97 (diff)
downloadjquery-ui-6a621b6d0e9b60ec75352429a3d1015989a0bd78.tar.gz
jquery-ui-6a621b6d0e9b60ec75352429a3d1015989a0bd78.zip
Core: isOverAxis avoid duplicated method logic.
Diffstat (limited to 'ui')
-rw-r--r--ui/ui.core.js13
1 files changed, 4 insertions, 9 deletions
diff --git a/ui/ui.core.js b/ui/ui.core.js
index f9c8a1486..7bafe917a 100644
--- a/ui/ui.core.js
+++ b/ui/ui.core.js
@@ -118,19 +118,14 @@ $.ui = {
return has;
},
- isOverHeight: function(y, top, height) {
- //Determines when y coordinate is over "b" element height
- return (y > top) && (y < (top + height));
- },
-
- isOverWidth: function(x, left, width) {
- //Determines when x coordinate is over "b" element width
- return (x > left) && (x < (left + width));
+ isOverAxis: function(x, reference, size) {
+ //Determines when x coordinate is over "b" element axis
+ return (x > reference) && (x < (reference + size));
},
isOver: function(y, x, top, left, height, width) {
//Determines when x, y coordinates is over "b" element
- return $.ui.isOverHeight(y, top, height) && $.ui.isOverWidth(x, left, width);
+ return $.ui.isOverAxis(y, top, height) && $.ui.isOverAxis(x, left, width);
}
};