Media: Move Attachments view preventDefault handler to the events object. see #21390.

git-svn-id: http://core.svn.wordpress.org/trunk@22651 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Daryl Koopersmith 2012-11-19 01:17:30 +00:00
parent cae8ce47fc
commit 10eada54dc
1 changed files with 2 additions and 5 deletions

View File

@ -2204,7 +2204,8 @@
'change [data-setting] input': 'updateSetting',
'change [data-setting] select': 'updateSetting',
'change [data-setting] textarea': 'updateSetting',
'click .close': 'removeFromLibrary'
'click .close': 'removeFromLibrary',
'click a': 'preventDefault'
},
buttons: {},
@ -2220,14 +2221,10 @@
// Update the model's details view.
this.model.on( 'selection:single selection:unsingle', this.details, this );
this.details( this.model, this.controller.state().get('selection') );
// Prevent default navigation on all links.
this.$el.on( 'click', 'a', this.preventDefault );
},
destroy: function() {
this.model.off( null, null, this );
this.$el.off( 'click', 'a', this.preventDefault );
this.remove();
},