Changeset 22965
- Timestamp:
- 12/02/2012 12:43:08 AM (13 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/js/media-views.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/js/media-views.js
r22957 r22965 3412 3412 3413 3413 media.view.Settings.prototype.initialize.apply( this, arguments ); 3414 this.model.on( 'change:link', this.update CustomLink, this );3414 this.model.on( 'change:link', this.updateLinkTo, this ); 3415 3415 3416 3416 if ( attachment ) … … 3436 3436 3437 3437 media.view.Settings.prototype.render.call( this ); 3438 this.update CustomLink();3438 this.updateLinkTo(); 3439 3439 return this; 3440 3440 }, 3441 3441 3442 updateCustomLink: function() { 3443 var isCustom = 'custom' === this.model.get('link'), 3444 $input = this.$('.link-to-custom'); 3445 3446 if ( ! isCustom ) { 3442 updateLinkTo: function() { 3443 var linkTo = this.model.get('link'), 3444 $input = this.$('.link-to-custom'), 3445 attachment = this.options.attachment; 3446 3447 if ( 'none' === linkTo ) { 3447 3448 $input.hide(); 3448 3449 return; … … 3450 3451 3451 3452 $input.show(); 3452 if ( ! this.model.get('linkUrl') ) 3453 3454 if ( 'post' == linkTo ) { 3455 $input.val( attachment.get('link') ); 3456 } else if ( 'file' == linkTo ) { 3457 $input.val( attachment.get('url') ); 3458 } else if ( ! this.model.get('linkUrl') ) { 3453 3459 $input.val('http://'); 3460 } 3461 3462 $input.prop('readonly', 'custom' !== linkTo); 3454 3463 3455 3464 // If the input is visible, focus and select its contents.
Note: See TracChangeset
for help on using the changeset viewer.