Skip to content
Permalink
Browse files

Core: isOverAxis avoid duplicated method logic.

  • Loading branch information
eduardolundgren committed Nov 21, 2008
1 parent 8979395 commit 6a621b6d0e9b60ec75352429a3d1015989a0bd78
Showing with 4 additions and 9 deletions.
  1. +4 −9 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);
}
};

0 comments on commit 6a621b6

Please sign in to comment.
You can’t perform that action at this time.