diff --git src/wp-includes/js/media-views.js src/wp-includes/js/media-views.js
index c74040c..635fe43 100644
|
|
|
6226 | 6226 | events: _.defaults( media.view.Settings.AttachmentDisplay.prototype.events, { |
6227 | 6227 | 'click .edit-attachment': 'editAttachment', |
6228 | 6228 | 'click .replace-attachment': 'replaceAttachment', |
6229 | | 'click .advanced-toggle': 'toggleAdvanced', |
| 6229 | 'click .advanced-toggle': 'onToggleAdvanced', |
6230 | 6230 | 'change [data-setting="customWidth"]': 'onCustomSize', |
6231 | 6231 | 'change [data-setting="customHeight"]': 'onCustomSize', |
6232 | 6232 | 'keyup [data-setting="customWidth"]': 'onCustomSize', |
… |
… |
|
6238 | 6238 | this.listenTo( this.model, 'change:url', this.updateUrl ); |
6239 | 6239 | this.listenTo( this.model, 'change:link', this.toggleLinkSettings ); |
6240 | 6240 | this.listenTo( this.model, 'change:size', this.toggleCustomSize ); |
| 6241 | |
6241 | 6242 | media.view.Settings.AttachmentDisplay.prototype.initialize.apply( this, arguments ); |
6242 | 6243 | }, |
6243 | 6244 | |
… |
… |
|
6277 | 6278 | postRender: function() { |
6278 | 6279 | setTimeout( _.bind( this.resetFocus, this ), 10 ); |
6279 | 6280 | this.toggleLinkSettings(); |
| 6281 | if ( getUserSetting( 'advImgDetails' ) === 'show' ) { |
| 6282 | this.toggleAdvanced( true ); |
| 6283 | } |
6280 | 6284 | this.trigger( 'post-render' ); |
6281 | 6285 | }, |
6282 | 6286 | |
… |
… |
|
6329 | 6333 | } |
6330 | 6334 | }, |
6331 | 6335 | |
6332 | | toggleAdvanced: function( event ) { |
6333 | | var $advanced = $( event.target ).closest( '.advanced-section' ); |
| 6336 | onToggleAdvanced: function( event ) { |
6334 | 6337 | event.preventDefault(); |
6335 | | if ( $advanced.hasClass('advanced-visible') ) { |
| 6338 | this.toggleAdvanced(); |
| 6339 | }, |
| 6340 | |
| 6341 | toggleAdvanced: function( show ) { |
| 6342 | var $advanced = this.$el.find( '.advanced-section' ), |
| 6343 | mode; |
| 6344 | |
| 6345 | if ( $advanced.hasClass('advanced-visible') || show === false ) { |
6336 | 6346 | $advanced.removeClass('advanced-visible'); |
6337 | 6347 | $advanced.find('.advanced-settings').addClass('hidden'); |
| 6348 | mode = 'hide'; |
6338 | 6349 | } else { |
6339 | 6350 | $advanced.addClass('advanced-visible'); |
6340 | 6351 | $advanced.find('.advanced-settings').removeClass('hidden'); |
| 6352 | mode = 'show'; |
6341 | 6353 | } |
| 6354 | |
| 6355 | setUserSetting( 'advImgDetails', mode ); |
6342 | 6356 | }, |
6343 | 6357 | |
6344 | 6358 | editAttachment: function( event ) { |