Browse files

BUGFIX: clean up Chosen classess, so the cached panel can be rebuilt …


There is no way to clean up attached Chosen instance in a nice way -
there is no destroy, nor remove on the library.

Also, we can't use the onunmatch on this entwine - it only triggers after the cache snapshot
has been taken. This is because the cache function is on different
  • Loading branch information...
1 parent 7f4c6e3 commit b28a625f0ba0584218956cbf45c5789950d27f3b @mateusz mateusz committed May 11, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 admin/javascript/LeftAndMain.js
@@ -489,6 +489,10 @@ jQuery.noConflict();
// Explicitly disable default placeholder if no custom one is defined
if(!'placeholder'))'placeholder', ' ');
+ // We could've gotten stale classes and DOM elements from deferred cache.
+ this.removeClass('has-chzn chzn-done');
+ this.siblings('.chzn-container').remove();
// Apply Chosen

0 comments on commit b28a625

Please sign in to comment.