Fixing jquery.flot.resize ie8 'Uncaught TypeError' #1265

Closed
wants to merge 1 commit into
from

3 participants

@tleish

Even with the updated jquery.flot.resize.js I was still receiving this error in IE8 just like #1081.

Uncaught TypeError: Cannot set property 'w' of undefined

Simply fixed by adding changing the following

Original:

function s(t,i,s){
    var o=$(this),u=o.data(a);
    u.w=i!==n?i:o.width(), u.h=s!==n?s:o.height(), r.apply(this,arguments)    
}

to include a conditional Conditional:

function s(t,i,s){
    var o=$(this),u=o.data(a);
    if(u){
        u.w=i!==n?i:o.width(), u.h=s!==n?s:o.height(), r.apply(this,arguments)
    }      
}

No more IE8 error, resizing still works.

@tleish tleish Fixing jquery.flot.resize ie8 'Uncaught TypeError'
Even with the updated jquery.flot.resize.js I was still receiving this error in IE8 just like #1081.

Uncaught TypeError: Cannot set property 'w' of undefined

Simply fixed by adding changing the following

Original:
===============
function s(t,i,s){
    var o=$(this),u=o.data(a);
    u.w=i!==n?i:o.width(), u.h=s!==n?s:o.height(), r.apply(this,arguments)
}
===============

to include a conditional Conditional:

===============
function s(t,i,s){
    var o=$(this),u=o.data(a);
    if(u){
        u.w=i!==n?i:o.width(), u.h=s!==n?s:o.height(), r.apply(this,arguments)
    }
}
===============

No more error, resizing still works
c6819ee
@nschonni nschonni added the triage label Mar 25, 2014
@nschonni
Flot member

Editing minified code is usually problematic. Can you trace it to an existing issue upstream https://github.com/cowboy/jquery-resize so that a comment can be added if modifiying the minified code is the only option.

I'd suggest trying @dnschnur's advice in the original thread around ensuring that the element is actually in the DOM.

@tleish

I submitted a pull request to cowboy/jquery-resize (see: cowboy/jquery-resize#21), but no changes have been made to the plugin for 4 years and there are 8 pull requests (including mine), some are over 2 years old. I doubt my pull request will be merged in.

@dnschnur dnschnur added bug and removed triage labels Apr 1, 2014
@dnschnur dnschnur added this to the Release 0.8.3 milestone Apr 1, 2014
@dnschnur dnschnur self-assigned this Apr 1, 2014
@dnschnur dnschnur added a commit to dnschnur/flot that referenced this pull request Apr 20, 2014
@dnschnur dnschnur Update the inline resize plugin with recent fixes.
This updates the inline resize plugin with
flot/jquery-resize@7471675 and flot/jquery-resize@189b555.

Fixes #1277 and #1265.
7aec501
@dnschnur dnschnur closed this Apr 20, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment