Permalink
Browse files

setting flags inside of backbone object, as well as adding jquery tri…

…ggers. This lets me keep the checkbox open after the modal refreshes due to the autosave. fixes #2
  • Loading branch information...
1 parent 22931a7 commit e772c09b5764f9173c186b4d09fe89254aef955a @eddiemoya committed Dec 15, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 media-categories-script.js
@@ -53,15 +53,23 @@ jQuery(document).ready(function($){
if(metabox_container.find('.arrow-down').length > 0){
metabox_container.find('.arrow-down').attr('class', 'arrow-up');
+ wp.media.view.AttachmentCompat.prototype.metabox_status = 'open';
} else {
metabox_container.find('.arrow-up').attr('class', 'arrow-down');
+ wp.media.view.AttachmentCompat.prototype.metabox_status = 'closed';
}
}
$('.compat-attachment-fields').live('modal-refreshed', function(){
$(input_class).hide();
$(metabox_class).addClass('metabox_container');
+
+ if(wp.media.view.AttachmentCompat.prototype.metabox_status == 'open'){
+ $(metabox_class).find('td.field').show();
+ $(metabox_class).find('.arrow-down').attr('class', 'arrow-up');
+ }
+
})
$('.attachments').live('click', function(){

0 comments on commit e772c09

Please sign in to comment.