Issue #2158979 by nod_: Drupal.dialog expects a DOM element, not a string or jQuery object.

8.0.x
Nathaniel Catchpole 2014-01-07 11:06:41 +00:00
parent 9790381a83
commit 01b27e2598
4 changed files with 8 additions and 5 deletions

View File

@ -105,7 +105,7 @@
// Open the dialog itself.
response.dialogOptions = response.dialogOptions || {};
var dialog = Drupal.dialog($dialog, response.dialogOptions);
var dialog = Drupal.dialog($dialog.get(0), response.dialogOptions);
if (response.dialogOptions.modal) {
dialog.showModal();
}
@ -125,7 +125,7 @@
Drupal.AjaxCommands.prototype.closeDialog = function (ajax, response, status) {
var $dialog = $(response.selector);
if ($dialog.length) {
Drupal.dialog($dialog).close();
Drupal.dialog($dialog.get(0)).close();
if (!response.persist) {
$dialog.remove();
}

View File

@ -1345,7 +1345,8 @@ function openGroupNameDialog (view, $group, callback) {
}
// Create a Drupal dialog that will get a button group name from the user.
var dialog = Drupal.dialog(Drupal.theme('ckeditorButtonGroupNameForm'), {
var $ckeditorButtonGroupNameForm = $(Drupal.theme('ckeditorButtonGroupNameForm'));
var dialog = Drupal.dialog($ckeditorButtonGroupNameForm.get(0), {
title: Drupal.t('Button group name'),
dialogClass: 'ckeditor-name-toolbar-group',
resizable: false,

View File

@ -41,7 +41,8 @@ Drupal.edit.util.buildUrl = function (id, urlFormat) {
* The message to use in the modal dialog.
*/
Drupal.edit.util.networkErrorModal = function (title, message) {
var networkErrorModal = Drupal.dialog('<div>' + message + '</div>', {
var $message = $('<div>' + message + '</div>');
var networkErrorModal = Drupal.dialog($message.get(0), {
title: title,
dialogClass: 'edit-network-error',
buttons: [

View File

@ -350,7 +350,8 @@ Drupal.edit.AppView = Backbone.View.extend({
// Only instantiate if there isn't a modal instance visible yet.
if (!this.model.get('activeModal')) {
discardDialog = Drupal.dialog('<div>' + Drupal.t('You have unsaved changes') + '</div>', {
var $unsavedChanges = $('<div>' + Drupal.t('You have unsaved changes') + '</div>');
discardDialog = Drupal.dialog($unsavedChanges.get(0), {
title: Drupal.t('Discard changes?'),
dialogClass: 'edit-discard-modal',
resizable: false,