]> source.dussan.org Git - jquery-ui.git/commitdiff
Core: isOverAxis avoid duplicated method logic.
authorEduardo Lundgren <eduardolundgren@gmail.com>
Fri, 21 Nov 2008 18:41:19 +0000 (18:41 +0000)
committerEduardo Lundgren <eduardolundgren@gmail.com>
Fri, 21 Nov 2008 18:41:19 +0000 (18:41 +0000)
ui/ui.core.js

index f9c8a14861b589938a1c71d3b9f5c9ba45ae9de7..7bafe917afafdf3047ebf4c481f9e7cc09660554 100644 (file)
@@ -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);
        }
 };