summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorscottalan2017-10-13 14:13:15 (GMT)
committerolstjos2017-10-13 14:13:15 (GMT)
commit2cc01619ff33058ed99a022bdb2bcd29c1fa2bb2 (patch)
tree931455b0774908f2c5b104688d223a8ba0a683ed
parent8796a78fb538e8db6ca5e03003834cbdea28b231 (diff)
Issue #2795927 by Marco Vervoort, scottalan: Media-browser popup does not open for file-field on custom settings page
-rw-r--r--js/media.js14
1 files changed, 8 insertions, 6 deletions
diff --git a/js/media.js b/js/media.js
index bc7bb2a..1600325 100644
--- a/js/media.js
+++ b/js/media.js
@@ -18,12 +18,14 @@ Drupal.behaviors.mediaElement = {
var elements;
function initMediaBrowser(selector) {
- $context.find(selector)
- .once('media-browser-launch')
- .siblings('.browse').show()
- .siblings('.upload').hide()
- .siblings('.attach').hide()
- .siblings('.browse').bind('click', {configuration: settings.media.elements[selector]}, Drupal.media.openBrowser);
+ var widget=$context.find(selector).once('media-browser-launch');
+ var browse=widget.siblings('.browse').add(widget.find('.browse'));
+ var upload=browse.siblings('.upload').add(widget.find('.upload'));
+ var attach=upload.siblings('.attach').add(widget.find('.attach'));
+ browse.show();
+ upload.hide();
+ attach.hide();
+ browse.bind('click', {configuration: settings.media.elements[selector]}, Drupal.media.openBrowser);
}
if (settings.media && settings.media.elements) {