Skip to content

Conversation

tleish
Copy link

@tleish tleish commented Mar 19, 2014

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.

Even with the updated jquery.flot.resize.js I was still receiving this error in IE8 just like flot#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
@nschonni
Copy link
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
Copy link
Author

tleish commented Mar 31, 2014

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 added a commit to dnschnur/flot that referenced this pull request Apr 20, 2014
@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
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants