Chris@0: /** Chris@0: * @file Chris@0: * AJAX commands used by Editor module. Chris@0: */ Chris@0: Chris@17: (function($, Drupal) { Chris@0: /** Chris@0: * Command to save the contents of an editor-provided modal. Chris@0: * Chris@0: * This command does not close the open modal. It should be followed by a Chris@0: * call to `Drupal.AjaxCommands.prototype.closeDialog`. Editors that are Chris@0: * integrated with dialogs must independently listen for an Chris@0: * `editor:dialogsave` event to save the changes into the contents of their Chris@0: * interface. Chris@0: * Chris@0: * @param {Drupal.Ajax} [ajax] Chris@0: * The Drupal.Ajax object. Chris@0: * @param {object} response Chris@0: * The server response from the ajax request. Chris@0: * @param {Array} response.values Chris@0: * The values that were saved. Chris@0: * @param {number} [status] Chris@0: * The status code from the ajax request. Chris@0: * Chris@0: * @fires event:editor:dialogsave Chris@0: */ Chris@17: Drupal.AjaxCommands.prototype.editorDialogSave = function( Chris@17: ajax, Chris@17: response, Chris@17: status, Chris@17: ) { Chris@0: $(window).trigger('editor:dialogsave', [response.values]); Chris@0: }; Chris@17: })(jQuery, Drupal);