Mercurial > hg > isophonics-drupal-site
annotate core/modules/editor/js/editor.dialog.es6.js @ 19:fa3358dc1485 tip
Add ndrum files
author | Chris Cannam |
---|---|
date | Wed, 28 Aug 2019 13:14:47 +0100 |
parents | 129ea1e6d783 |
children |
rev | line source |
---|---|
Chris@0 | 1 /** |
Chris@0 | 2 * @file |
Chris@0 | 3 * AJAX commands used by Editor module. |
Chris@0 | 4 */ |
Chris@0 | 5 |
Chris@17 | 6 (function($, Drupal) { |
Chris@0 | 7 /** |
Chris@0 | 8 * Command to save the contents of an editor-provided modal. |
Chris@0 | 9 * |
Chris@0 | 10 * This command does not close the open modal. It should be followed by a |
Chris@0 | 11 * call to `Drupal.AjaxCommands.prototype.closeDialog`. Editors that are |
Chris@0 | 12 * integrated with dialogs must independently listen for an |
Chris@0 | 13 * `editor:dialogsave` event to save the changes into the contents of their |
Chris@0 | 14 * interface. |
Chris@0 | 15 * |
Chris@0 | 16 * @param {Drupal.Ajax} [ajax] |
Chris@0 | 17 * The Drupal.Ajax object. |
Chris@0 | 18 * @param {object} response |
Chris@0 | 19 * The server response from the ajax request. |
Chris@0 | 20 * @param {Array} response.values |
Chris@0 | 21 * The values that were saved. |
Chris@0 | 22 * @param {number} [status] |
Chris@0 | 23 * The status code from the ajax request. |
Chris@0 | 24 * |
Chris@0 | 25 * @fires event:editor:dialogsave |
Chris@0 | 26 */ |
Chris@17 | 27 Drupal.AjaxCommands.prototype.editorDialogSave = function( |
Chris@17 | 28 ajax, |
Chris@17 | 29 response, |
Chris@17 | 30 status, |
Chris@17 | 31 ) { |
Chris@0 | 32 $(window).trigger('editor:dialogsave', [response.values]); |
Chris@0 | 33 }; |
Chris@17 | 34 })(jQuery, Drupal); |