From 37fe9438dd6552d017d1dbb500966b2892ac3492 Mon Sep 17 00:00:00 2001 From: Daryl Koopersmith Date: Thu, 11 Oct 2012 04:04:12 +0000 Subject: [PATCH] Media Modal: Attachments on the gallery page now inherit general events with the exception of click-to-select. see #21390. git-svn-id: https://develop.svn.wordpress.org/trunk@22183 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/js/media-views.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/wp-includes/js/media-views.js b/wp-includes/js/media-views.js index 57e63bbc9c..21be0615e8 100644 --- a/wp-includes/js/media-views.js +++ b/wp-includes/js/media-views.js @@ -385,10 +385,11 @@ template: media.template('attachment'), events: { - 'click .attachment-preview': 'toggleSelection', + 'click .attachment-preview': 'toggleSelection', 'mouseenter .attachment-preview': 'shrink', 'mouseleave .attachment-preview': 'expand', - 'change .describe': 'describe' + 'change .describe': 'describe', + 'click .close': 'toggleSelection' }, buttons: {}, @@ -562,9 +563,11 @@ close: true }, - events: { - 'click .close': 'toggleSelection' - } + events: (function() { + var events = _.clone( media.view.Attachment.prototype.events ); + delete events['click .attachment-preview']; + return events; + }()) }); /**