mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Core: isOverAxis avoid duplicated method logic.
This commit is contained in:
parent
89793957e5
commit
6a621b6d0e
@ -118,19 +118,14 @@ $.ui = {
|
|||||||
return has;
|
return has;
|
||||||
},
|
},
|
||||||
|
|
||||||
isOverHeight: function(y, top, height) {
|
isOverAxis: function(x, reference, size) {
|
||||||
//Determines when y coordinate is over "b" element height
|
//Determines when x coordinate is over "b" element axis
|
||||||
return (y > top) && (y < (top + height));
|
return (x > reference) && (x < (reference + size));
|
||||||
},
|
|
||||||
|
|
||||||
isOverWidth: function(x, left, width) {
|
|
||||||
//Determines when x coordinate is over "b" element width
|
|
||||||
return (x > left) && (x < (left + width));
|
|
||||||
},
|
},
|
||||||
|
|
||||||
isOver: function(y, x, top, left, height, width) {
|
isOver: function(y, x, top, left, height, width) {
|
||||||
//Determines when x, y coordinates is over "b" element
|
//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);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user