Skip to content

Commit 6a621b6

Browse files
Core: isOverAxis avoid duplicated method logic.
1 parent 8979395 commit 6a621b6

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

ui/ui.core.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -118,19 +118,14 @@ $.ui = {
118118
return has;
119119
},
120120

121-
isOverHeight: function(y, top, height) {
122-
//Determines when y coordinate is over "b" element height
123-
return (y > top) && (y < (top + height));
124-
},
125-
126-
isOverWidth: function(x, left, width) {
127-
//Determines when x coordinate is over "b" element width
128-
return (x > left) && (x < (left + width));
121+
isOverAxis: function(x, reference, size) {
122+
//Determines when x coordinate is over "b" element axis
123+
return (x > reference) && (x < (reference + size));
129124
},
130125

131126
isOver: function(y, x, top, left, height, width) {
132127
//Determines when x, y coordinates is over "b" element
133-
return $.ui.isOverHeight(y, top, height) && $.ui.isOverWidth(x, left, width);
128+
return $.ui.isOverAxis(y, top, height) && $.ui.isOverAxis(x, left, width);
134129
}
135130
};
136131

0 commit comments

Comments
 (0)