mercury_editor-2.0.x-dev/source/js/select-component.ajax.js
source/js/select-component.ajax.js
((Drupal) => {
/**
* Ajax command for removing a class from matching element(s).
* @param {Drupal.Ajax} [ajax] An Ajax object.
* @param {object} response The response object.
*/
Drupal.AjaxCommands.prototype.mercuryEditorSelectComponent = (ajax, response) => {
if (response.uuid === undefined) {
return;
}
const previewFrame = document.querySelector('#me-preview')?.contentWindow || window;
previewFrame.postMessage({
type: 'componentSelected',
settings: { uuid: response.uuid },
});
};
})(Drupal);
