Skip to content

Commit

Permalink
replaces deprecated jQuery.support.boxModel reference
Browse files Browse the repository at this point in the history
jQuery.support.boxModel was removed in 1.10/2.0 .
See http://bugs.jquery.com/ticket/13743 .
  • Loading branch information
usmonster committed Sep 17, 2013
1 parent a7d93b8 commit 997f683
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions js/jquery.fn.gantt.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,19 +204,23 @@
// Core object is responsible for navigation and rendering
var core = {
// Return the element whose topmost point lies under the given point
// Normalizes for IE
elementFromPoint: function (x, y) {

if (!$.support.boxModel) {
// Normalizes for old browsers
elementFromPoint: (function(){ // IIFE
// version for normal browsers
if (document.compatMode === "CSS1Compat") {
return function (x, y) {
x -= window.pageXOffset;
y -= window.pageYOffset;
return document.elementFromPoint(x, y);
};
}
// version for older browsers
return function (x, y) {
x -= $(document).scrollLeft();
y -= $(document).scrollTop();
} else {
x -= window.pageXOffset;
y -= window.pageYOffset;
}

return document.elementFromPoint(x, y);
},
return document.elementFromPoint(x, y);
};
})(),

// **Create the chart**
create: function (element) {
Expand Down

0 comments on commit 997f683

Please sign in to comment.