diff --git a/modules/lightning_features/lightning_media/js/browser.js b/modules/lightning_features/lightning_media/js/browser.js index ec28635..b2793cc 100644 --- a/modules/lightning_features/lightning_media/js/browser.js +++ b/modules/lightning_features/lightning_media/js/browser.js @@ -115,6 +115,21 @@ if (element) { $(element).data('view', new Selection({ el: element })); } + + // Double click on a selectable media entity. + $('form.entity-browser-form .view .views-col').on('dblclick', function () { + + // Select the current clicked entity. + $(this).addClass('selected').find($('js-form-item .form-checkbox')).prop('checked', true); + // Unselect everything else. + $('form.entity-browser-form .view .views-co', context).not(this).removeClass('selected').find($('js-form-item .form-checkbox')).prop('checked', false); + + // Enable the submit button for this entity browser. + $('form.entity-browser-form input.is-entity-browser-submit').removeAttr('disabled'); + + // Auto submit the entity browser form. + $('form.entity-browser-form input.is-entity-browser-submit').click(); + }); }, detach: function (context) {