doctyper / flexie

Legacy support for the CSS3 Flexible Box Model
http://flexiejs.com
1.1k stars 110 forks source link

TypeError: Cannot call method 'updateModel' of undefined #27

Open spaceninja opened 12 years ago

spaceninja commented 12 years ago

I'm using Flexie on a wordpress theme that uses Disqus for comments. The flexbox layout works fine, except on pages where Disqus (which adds comments after page load via JS) would cause the content column to grow longer -- instead of expanding to accomodate the new content, it just overflows out of the box.

I was able to find a JS trigger for when Disqus finishes drawing, and am using it to call Flexie.updateInstance() like so:

function disqus_config() {
    this.callbacks.afterRender = [function() {
        alert('hello');
        Flexie.updateInstance();
    }];
}

The alert triggers fine, but the Flexie command throws the following error: TypeError: Cannot call method 'updateModel' of undefined

Any ideas what I'm doing wrong?

doctyper commented 12 years ago

Hm, it sounds like it's trying to call updateInstance on an invalid object. Does the function fire before stylesheets or Flexie itself is loaded?

I can suppress the error, but I don't know if that will help update a Flexie instance it can't find.