Commit 01b27e25 authored by catch's avatar catch

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

parent 9790381a
...@@ -105,7 +105,7 @@ ...@@ -105,7 +105,7 @@
// Open the dialog itself. // Open the dialog itself.
response.dialogOptions = response.dialogOptions || {}; response.dialogOptions = response.dialogOptions || {};
var dialog = Drupal.dialog($dialog, response.dialogOptions); var dialog = Drupal.dialog($dialog.get(0), response.dialogOptions);
if (response.dialogOptions.modal) { if (response.dialogOptions.modal) {
dialog.showModal(); dialog.showModal();
} }
...@@ -125,7 +125,7 @@ ...@@ -125,7 +125,7 @@
Drupal.AjaxCommands.prototype.closeDialog = function (ajax, response, status) { Drupal.AjaxCommands.prototype.closeDialog = function (ajax, response, status) {
var $dialog = $(response.selector); var $dialog = $(response.selector);
if ($dialog.length) { if ($dialog.length) {
Drupal.dialog($dialog).close(); Drupal.dialog($dialog.get(0)).close();
if (!response.persist) { if (!response.persist) {
$dialog.remove(); $dialog.remove();
} }
......
...@@ -1345,7 +1345,8 @@ function openGroupNameDialog (view, $group, callback) { ...@@ -1345,7 +1345,8 @@ function openGroupNameDialog (view, $group, callback) {
} }
// Create a Drupal dialog that will get a button group name from the user. // 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'), title: Drupal.t('Button group name'),
dialogClass: 'ckeditor-name-toolbar-group', dialogClass: 'ckeditor-name-toolbar-group',
resizable: false, resizable: false,
......
...@@ -41,7 +41,8 @@ Drupal.edit.util.buildUrl = function (id, urlFormat) { ...@@ -41,7 +41,8 @@ Drupal.edit.util.buildUrl = function (id, urlFormat) {
* The message to use in the modal dialog. * The message to use in the modal dialog.
*/ */
Drupal.edit.util.networkErrorModal = function (title, message) { 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, title: title,
dialogClass: 'edit-network-error', dialogClass: 'edit-network-error',
buttons: [ buttons: [
......
...@@ -350,7 +350,8 @@ Drupal.edit.AppView = Backbone.View.extend({ ...@@ -350,7 +350,8 @@ Drupal.edit.AppView = Backbone.View.extend({
// Only instantiate if there isn't a modal instance visible yet. // Only instantiate if there isn't a modal instance visible yet.
if (!this.model.get('activeModal')) { 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?'), title: Drupal.t('Discard changes?'),
dialogClass: 'edit-discard-modal', dialogClass: 'edit-discard-modal',
resizable: false, resizable: false,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment