Commit 2cc01619 authored by scottalan's avatar scottalan Committed by olstjos

Issue #2795927 by Marco Vervoort, scottalan: Media-browser popup does not open...

Issue #2795927 by Marco Vervoort, scottalan: Media-browser popup does not open for file-field on custom settings page
parent 8796a78f
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment