diff --git a/core/misc/ajax.js b/core/misc/ajax.js index 4a1e327..53351ad 100644 --- a/core/misc/ajax.js +++ b/core/misc/ajax.js @@ -566,7 +566,8 @@ Drupal.ajax.prototype.commands = { // @todo Consider whether this is overloading title inappropriately, and // if so, find another way to determine dialog eligibility. if (ajax.dialog && ('title' in response)) { - var dialog = Drupal.dialog(wrapper, {title: response.title}); + var dialogOptions = $.extend({title: response.title}, ajax.dialog); + var dialog = Drupal.dialog(wrapper, dialogOptions); ajax.dialog.modal ? dialog.showModal() : dialog.show(); } diff --git a/core/misc/dialog.js b/core/misc/dialog.js index c0bccf1..a0849bc 100644 --- a/core/misc/dialog.js +++ b/core/misc/dialog.js @@ -30,7 +30,7 @@ Drupal.behaviors.dialog = { Drupal.dialog = function (element, options) { function openDialog (settings) { - settings = $.extend(settings, defaults); + settings = $.extend({}, drupalSettings.dialog, options, settings); // Trigger a global event to allow scripts to bind events to the dialog. $(window).trigger('dialog:beforecreate', [dialog, $element, settings]); $element.dialog(settings); @@ -48,7 +48,6 @@ Drupal.dialog = function (element, options) { var undef; var $element = $(element); - var defaults = $.extend(options, drupalSettings.dialog); var dialog = { open: false, returnValue: undef,