Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit e772c09b5764f9173c186b4d09fe89254aef955a 1 parent 22931a7
@eddiemoya authored
Showing with 8 additions and 0 deletions.
  1. +8 −0 media-categories-script.js
View
8 media-categories-script.js
@@ -53,8 +53,10 @@ 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';
}
}
@@ -62,6 +64,12 @@ jQuery(document).ready(function($){
$('.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(){
Please sign in to comment.
Something went wrong with that request. Please try again.