flexie icon indicating copy to clipboard operation
flexie copied to clipboard

TypeError: Cannot call method 'updateModel' of undefined

Open spaceninja opened this issue 12 years ago • 1 comments

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?

spaceninja avatar Oct 27 '11 18:10 spaceninja

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.

doctyper avatar Oct 27 '11 20:10 doctyper