Including security review as a submodule - with patched for Yaffs.
[yaffs-website] / web / modules / contrib / entity_browser / js / entity_browser.modal_selection.js
1 /**
2  * @file entity_browser.modal_selection.js
3  *
4  * Propagates selected entities from modal display.
5  */
6
7 (function (drupalSettings) {
8
9   'use strict';
10
11   // We need to access parent window, get it's jquery and find correct modal
12   // element to trigger event on.
13   parent.jQuery(parent.document)
14     .find(':input[data-uuid*=' + drupalSettings.entity_browser.modal.uuid + ']')
15     .trigger('entities-selected', [drupalSettings.entity_browser.modal.uuid, drupalSettings.entity_browser.modal.entities])
16     .unbind('entities-selected').show();
17
18   // This is a silly solution, but works fo now. We should close the modal
19   // via ajax commands.
20   parent.jQuery(parent.document).find('.entity-browser-modal-iframe').parents('.ui-dialog').eq(0).find('.ui-dialog-titlebar-close').click();
21
22 }(drupalSettings));