Skip to content

Commit 997f683

Browse files
committed
replaces deprecated jQuery.support.boxModel reference
jQuery.support.boxModel was removed in 1.10/2.0 . See http://bugs.jquery.com/ticket/13743 .
1 parent a7d93b8 commit 997f683

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

js/jquery.fn.gantt.js

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -204,19 +204,23 @@
204204
// Core object is responsible for navigation and rendering
205205
var core = {
206206
// Return the element whose topmost point lies under the given point
207-
// Normalizes for IE
208-
elementFromPoint: function (x, y) {
209-
210-
if (!$.support.boxModel) {
207+
// Normalizes for old browsers
208+
elementFromPoint: (function(){ // IIFE
209+
// version for normal browsers
210+
if (document.compatMode === "CSS1Compat") {
211+
return function (x, y) {
212+
x -= window.pageXOffset;
213+
y -= window.pageYOffset;
214+
return document.elementFromPoint(x, y);
215+
};
216+
}
217+
// version for older browsers
218+
return function (x, y) {
211219
x -= $(document).scrollLeft();
212220
y -= $(document).scrollTop();
213-
} else {
214-
x -= window.pageXOffset;
215-
y -= window.pageYOffset;
216-
}
217-
218-
return document.elementFromPoint(x, y);
219-
},
221+
return document.elementFromPoint(x, y);
222+
};
223+
})(),
220224

221225
// **Create the chart**
222226
create: function (element) {

0 commit comments

Comments
 (0)