File tree Expand file tree Collapse file tree 1 file changed +15
-11
lines changed Expand file tree Collapse file tree 1 file changed +15
-11
lines changed Original file line number Diff line number Diff line change 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 ) {
You can’t perform that action at this time.
0 commit comments