diff --git a/core/misc/dialog.ajax.js b/core/misc/dialog.ajax.js
index 90c9d26..1b7c850 100644
--- a/core/misc/dialog.ajax.js
+++ b/core/misc/dialog.ajax.js
@@ -40,6 +40,22 @@
response.method = 'html';
ajax.commands.insert(ajax, response, status);
+ // If the dialog contains a form-actions wrapper, move the buttons to the
+ // jQuery UI dialog buttons area.
+ if (!response.dialogOptions.buttons) {
+ response.dialogOptions.buttons = [];
+ $dialog.find('.form-actions input[type=submit]').each(function () {
+ var $originalButton = $(this).hide();
+ response.dialogOptions.buttons.push({
+ 'text': $originalButton.html() || $originalButton.attr('value'),
+ 'class': $originalButton.attr('class'),
+ 'click': function (e) {
+ $originalButton.trigger('mousedown');
+ }
+ });
+ });
+ }
+
// Open the dialog itself.
response.dialogOptions = response.dialogOptions || {};
var dialog = Drupal.dialog($dialog, response.dialogOptions);
@@ -49,6 +65,9 @@
else {
dialog.show();
}
+
+ // Add the standard Drupal class for buttons for style consistency.
+ $dialog.parent().find('.ui-dialog-buttonset').addClass('form-actions');
};
/**
@@ -61,6 +80,9 @@
if ($dialog.length) {
Drupal.dialog($dialog).close();
}
+
+ // Add the standard Drupal class for buttons for style consistency.
+ $dialog.parent().find('.ui-dialog-buttonset').addClass('form-actions')
};
/**
diff --git a/core/misc/dialog.theme.css b/core/misc/dialog.theme.css
new file mode 100644
index 0000000..adfaad2
--- /dev/null
+++ b/core/misc/dialog.theme.css
@@ -0,0 +1,72 @@
+/**
+ * Presentational styles for Drupal dialogs.
+ */
+
+.ui-dialog {
+ background: #fff;
+ border: solid 1px #ccc;
+ padding: 0;
+ /* We need this so the button is visible. */
+ overflow: visible;
+ position: fixed;
+}
+.ui-dialog .ui-dialog-titlebar {
+ font-weight: bold;
+ background: #f3f4ee;
+}
+.ui-dialog .ui-dialog-buttonpane {
+ border-width: 0;
+ margin-top: 0;
+ background: #f3f4ee;
+ padding: .3em 1em;
+}
+.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
+ margin: 0;
+ float: none;
+}
+.ui-dialog .ui-dialog-buttonpane .ui-button-text-only .ui-button-text {
+ padding: 0;
+}
+
+/* Form action buttons are moved in dialogs. Remove empty space. */
+.ui-dialog .ui-dialog-content .form-actions {
+ padding: 0;
+ margin: 0;
+}
+.ui-dialog .ajax-progress-throbber {
+ /* Can't do center:50% middle: 50%, so approximate it for a typical window size. */
+ left: 49%;
+ position: fixed;
+ top: 48.5%;
+ z-index: 1000;
+ background-color: #232323;
+ background-image: url("loading-small.gif");
+ background-position: center center;
+ background-repeat: no-repeat;
+ border-radius: 7px;
+ height: 24px;
+ opacity: 0.9;
+ padding: 4px;
+ width: 24px;
+}
+.ui-dialog .ajax-progress-throbber .message {
+ display: none;
+}
+
+.ui-dialog .ui-dialog-titlebar-close {
+ background: url("close.png") no-repeat scroll 6px 3px #f3f4ee;
+ border-color: #aaa;
+ border-radius: 0 10px 12px 0;
+ border-style: solid;
+ border-width: 1px 1px 1px 0;
+ height: 22px;
+ width: 26px;
+ border-color: #cccccc;
+ right: -27px;
+ top: 9px;
+ padding: 0;
+}
+
+.ui-dialog .ui-dialog-titlebar-close span {
+ display: none;
+}
diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index cf877ac..ad3e383 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -1264,7 +1264,8 @@ function system_library_info() {
array('system', 'jquery'),
array('system', 'drupal'),
array('system', 'drupalSettings'),
- array('system', 'jquery.ui.dialog')
+ array('system', 'jquery.ui.dialog'),
+ array('system', 'drupal.debounce'),
),
);
diff --git a/core/modules/views/includes/ajax.inc b/core/modules/views/includes/ajax.inc
index d938e34..3b14834 100644
--- a/core/modules/views/includes/ajax.inc
+++ b/core/modules/views/includes/ajax.inc
@@ -7,7 +7,7 @@
use Symfony\Component\HttpFoundation\JsonResponse;
use Drupal\views\Ajax\HighlightCommand;
-use Drupal\views\Ajax\SetFormCommand;
+use Drupal\Core\Ajax\OpenModalDialogCommand;
use Drupal\Core\Ajax\ReplaceCommand;
use Drupal\views\Ajax\ScrollTopCommand;
use Drupal\views\Ajax\ViewAjaxResponse;
@@ -123,10 +123,14 @@ function views_ajax_form_wrapper($form_id, &$form_state) {
$display .= $output;
$title = empty($form_state['title']) ? '' : $form_state['title'];
-
- $url = empty($form_state['url']) ? url(current_path(), array('absolute' => TRUE)) : $form_state['url'];
-
- $response->addCommand(new SetFormCommand($display, $title, $url));
+ $options = array(
+ 'dialogClass' => 'views-ui-dialog',
+ 'resizable' => false,
+ 'width' => '85%',
+ 'height' => '400',
+ );
+
+ $response->addCommand(new OpenModalDialogCommand($title, $display, $options));
if (!empty($form_state['#section'])) {
$response->addCommand(new HighlightCommand('.' . drupal_clean_css_identifier($form_state['#section'])));
diff --git a/core/modules/views/js/jquery.ui.dialog.patch.js b/core/modules/views/js/jquery.ui.dialog.patch.js
deleted file mode 100644
index 1fb9b0b..0000000
--- a/core/modules/views/js/jquery.ui.dialog.patch.js
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * This is part of a patch to address a jQueryUI bug. The bug is responsible
- * for the inability to scroll a page when a modal dialog is active. If the content
- * of the dialog extends beyond the bottom of the viewport, the user is only able
- * to scroll with a mousewheel or up/down keyboard keys.
- *
- * @see http://bugs.jqueryui.com/ticket/4671
- * @see https://bugs.webkit.org/show_bug.cgi?id=19033
- * @see views_ui.module
- * @see js/jquery.ui.dialog.min.js
- *
- * This javascript patch overwrites the $.ui.dialog.overlay.events object to remove
- * the mousedown, mouseup and click events from the list of events that are bound
- * in $.ui.dialog.overlay.create
- *
- * The original code for this object:
- * $.ui.dialog.overlay.events: $.map('focus,mousedown,mouseup,keydown,keypress,click'.split(','),
- * function(event) { return event + '.dialog-overlay'; }).join(' '),
- *
- */
-
-(function ($, undefined) {
-
- "use strict";
-
- if ($.ui && $.ui.dialog) {
- $.ui.dialog.overlay.events = $.map('focus,keydown,keypress'.split(','),
- function(event) { return event + '.dialog-overlay'; }).join(' ');
- }
-}(jQuery));
diff --git a/core/modules/views/lib/Drupal/views/Ajax/DismissFormCommand.php b/core/modules/views/lib/Drupal/views/Ajax/DismissFormCommand.php
deleted file mode 100644
index 7dfa90f..0000000
--- a/core/modules/views/lib/Drupal/views/Ajax/DismissFormCommand.php
+++ /dev/null
@@ -1,28 +0,0 @@
- 'viewsDismissForm',
- );
- }
-
-}
diff --git a/core/modules/views/lib/Drupal/views/Ajax/SetFormCommand.php b/core/modules/views/lib/Drupal/views/Ajax/SetFormCommand.php
deleted file mode 100644
index b4f6297..0000000
--- a/core/modules/views/lib/Drupal/views/Ajax/SetFormCommand.php
+++ /dev/null
@@ -1,71 +0,0 @@
-output = $output;
- $this->title = $title;
- $this->url = $url;
- }
-
- /**
- * Implements \Drupal\Core\Ajax\CommandInterface::render().
- */
- public function render() {
- $command = array(
- 'command' => 'viewsSetForm',
- 'output' => $this->output,
- 'title' => $this->title,
- );
- if (isset($this->url)) {
- $command['url'] = $this->url;
- }
- return $command;
- }
-
-}
diff --git a/core/modules/views_ui/admin.inc b/core/modules/views_ui/admin.inc
index a723854..d8b7f07 100644
--- a/core/modules/views_ui/admin.inc
+++ b/core/modules/views_ui/admin.inc
@@ -392,20 +392,20 @@ function views_ui_standard_display_dropdown(&$form, &$form_state, $section) {
}
/**
- * Create the URL for one of our standard AJAX forms based upon known
+ * Create the menu path for one of our standard AJAX forms based upon known
* information about the form.
*/
-function views_ui_build_form_url($form_state) {
+function views_ui_build_form_path($form_state) {
$ajax = empty($form_state['ajax']) ? 'nojs' : 'ajax';
$name = $form_state['view']->id();
- $url = "admin/structure/views/$ajax/$form_state[form_key]/$name/$form_state[display_id]";
+ $path = "admin/structure/views/$ajax/$form_state[form_key]/$name/$form_state[display_id]";
if (isset($form_state['type'])) {
- $url .= '/' . $form_state['type'];
+ $path .= '/' . $form_state['type'];
}
if (isset($form_state['id'])) {
- $url .= '/' . $form_state['id'];
+ $path .= '/' . $form_state['id'];
}
- return $url;
+ return $path;
}
function _views_sort_types($a, $b) {
diff --git a/core/modules/views_ui/css/views-admin.css b/core/modules/views_ui/css/views-admin.css
index 64b8070..603df13 100644
--- a/core/modules/views_ui/css/views-admin.css
+++ b/core/modules/views_ui/css/views-admin.css
@@ -228,44 +228,12 @@
/* @group Modal dialog box */
.views-ui-dialog {
- /* We need this so the button is visible. */
- overflow: visible;
- position: fixed;
-}
-
-.views-ui-dialog .ui-dialog-titlebar-close {
- border: 1px solid transparent;
- display: block;
- margin: 0;
- padding: 0;
- position: absolute;
- right: 0;
- top: 2px;
- /* Make sure this is in front of the modal backdrop. */
- z-index: 1002;
-}
-
-.views-ui-dialog .ui-dialog-titlebar {
- padding: 0;
- margin: 0;
-}
-
-.views-ui-dialog .ui-dialog-title {
- display: none;
-}
-
-.views-ui-dialog #views-ajax-popup {
- padding: 0;
- overflow: hidden;
+ max-width: 85%;
+ max-height: 75%;
}
-.views-ui-dialog #views-ajax-title,
-.views-ui-dialog #views-ajax-body {
- margin: 0;
+.views-ui-dialog .ui-dialog-content {
padding: 0;
-}
-
-.views-ui-dialog #views-ajax-popup {
overflow: hidden;
}
@@ -351,18 +319,6 @@ html.js span.js-only {
display: none;
}
-/* Modal */
-#views-ajax-popup .ajax-progress-throbber {
- /* Can't do center:50% middle: 50%, so approximate it for a typical window size. */
- left: 49%;
- position: fixed;
- top: 48.5%;
- z-index: 1000;
-}
-#views-ajax-popup .ajax-progress-throbber .message {
- display: none;
-}
-
/* @end */
.js .views-edit-view .dropbutton-widget {
diff --git a/core/modules/views_ui/css/views-admin.theme.css b/core/modules/views_ui/css/views-admin.theme.css
index 59bed90..bb2c51a 100644
--- a/core/modules/views_ui/css/views-admin.theme.css
+++ b/core/modules/views_ui/css/views-admin.theme.css
@@ -769,31 +769,6 @@ ul#views-display-menu-tabs li.add ul.action-list li{
*
* The contents of the popup dialog on the views edit form.
*/
-
-.views-ui-dialog {
- font-size: small;
- padding: 0;
-}
-
-.views-ui-dialog .ui-dialog-titlebar-close {
- background: url("../images/close.png") no-repeat scroll 6px 3px #f3f4ee;
- border-color: #aaa;
- border-radius: 0 10px 12px 0;
- border-style: solid;
- border-width: 1px 1px 1px 0;
- -moz-box-shadow: 0 -2px 0 rgba(0, 0, 0, 0.1);
- -webkit-box-shadow: 0 -2px 0 rgba(0, 0, 0, 0.1);
- box-shadow: 0 -2px 0 rgba(0, 0, 0, 0.1);
- height: 22px;
- right: -28px;
- top: 0;
- width: 26px;
-}
-
-.views-ui-dialog .ui-dialog-titlebar-close span {
- display: none;
-}
-
.views-filterable-options .form-type-checkbox {
border: 1px solid #ccc;
padding: 5px 8px;
@@ -849,7 +824,6 @@ ul#views-display-menu-tabs li.add ul.action-list li{
padding: 6px 16px;
}
-.views-ui-dialog #views-ajax-title,
.views-ui-dialog .views-override {
background-color: #f3f4ee;
}
@@ -862,11 +836,6 @@ ul#views-display-menu-tabs li.add ul.action-list li{
margin: 0;
}
-.views-ui-dialog #views-ajax-title {
- font-size: 15px;
- padding: 8px 13px;
-}
-
.views-ui-dialog #views-progress-indicator {
font-size: 11px;
position: absolute;
@@ -886,21 +855,13 @@ ul#views-display-menu-tabs li.add ul.action-list li{
border: 1px solid #ccc;
border-width: 1px 0;
padding: 8px 13px;
+ background: #fff;
}
.views-ui-dialog details .item-list {
padding-left: 2em;
}
-.views-ui-dialog .form-buttons {
- background-color: #f3f4ee;
- padding: 8px 13px;
-}
-.views-ui-dialog .form-buttons input {
- margin-bottom: 0;
- margin-right: 0;
-}
-
/* @end */
/* @group Configure filter criteria */
@@ -1078,7 +1039,7 @@ ul#views-display-menu-tabs li.add ul.action-list li{
.ajax-progress-throbber {
background-color: #232323;
- background-image: url("../images/loading-small.gif");
+ background-image: url("../../../../misc/loading-small.gif");
background-position: center center;
background-repeat: no-repeat;
border-radius: 7px;
diff --git a/core/modules/views_ui/js/ajax.js b/core/modules/views_ui/js/ajax.js
index ef45e24..77b0941 100644
--- a/core/modules/views_ui/js/ajax.js
+++ b/core/modules/views_ui/js/ajax.js
@@ -6,42 +6,6 @@
"use strict";
- Drupal.ajax.prototype.commands.viewsSetForm = function (ajax, response, status) {
- var ajax_title = Drupal.settings.views.ajax.title;
- var ajax_body = Drupal.settings.views.ajax.id;
- var ajax_popup = Drupal.settings.views.ajax.popup;
- $(ajax_title).html(response.title);
- $(ajax_body).html(response.output);
- $(ajax_popup).dialog('open');
- Drupal.attachBehaviors($(ajax_popup), ajax.settings);
- if (response.url) {
- // Identify the button that was clicked so that .ajaxSubmit() can use it.
- // We need to do this for both .click() and .mousedown() since JavaScript
- // code might trigger either behavior.
- var $submit_buttons = $('input[type=submit], button', ajax_body);
- $submit_buttons.click(function(event) {
- this.form.clk = this;
- });
- $submit_buttons.mousedown(function(event) {
- this.form.clk = this;
- });
-
- $('form', ajax_body).once('views-ajax-submit-processed').each(function() {
- var element_settings = { 'url': response.url, 'event': 'submit', 'progress': { 'type': 'throbber' } };
- var $form = $(this);
- var id = $form.attr('id');
- Drupal.ajax[id] = new Drupal.ajax(id, this, element_settings);
- Drupal.ajax[id].form = $form;
- });
- }
- Drupal.viewsUi.resizeModal();
- };
-
- Drupal.ajax.prototype.commands.viewsDismissForm = function (ajax, response, status) {
- Drupal.ajax.prototype.commands.viewsSetForm({}, {'title': '', 'output': Drupal.settings.views.ajax.defaultForm});
- $(Drupal.settings.views.ajax.popup).dialog('close');
- };
-
Drupal.ajax.prototype.commands.viewsHighlight = function (ajax, response, status) {
$('.hilited').removeClass('hilited');
$(response.selector).addClass('hilited');
@@ -113,19 +77,6 @@
Drupal.behaviors.viewsAjax = {
collapseReplaced: false,
attach: function (context, settings) {
- if (!settings.views) {
- return;
- }
- // Create a jQuery UI dialog, but leave it closed.
- var dialog_area = $(settings.views.ajax.popup, context);
- dialog_area.dialog({
- 'autoOpen': false,
- 'dialogClass': 'views-ui-dialog',
- 'modal': true,
- 'position': 'center',
- 'resizable': false,
- 'width': 750
- });
var base_element_settings = {
'event': 'click',
diff --git a/core/modules/views_ui/js/views-admin.js b/core/modules/views_ui/js/views-admin.js
index f695e77..d7bc968 100644
--- a/core/modules/views_ui/js/views-admin.js
+++ b/core/modules/views_ui/js/views-admin.js
@@ -2,6 +2,10 @@
* @file
* Some basic behaviors and utility functions for Views UI.
*/
+(function ($) {
+
+"use strict";
+
Drupal.viewsUi = {};
Drupal.behaviors.viewsUiEditView = {};
@@ -10,13 +14,10 @@ Drupal.behaviors.viewsUiEditView = {};
* Improve the user experience of the views edit interface.
*/
Drupal.behaviors.viewsUiEditView.attach = function (context, settings) {
-
- "use strict";
-
// Only show the SQL rewrite warning when the user has chosen the
// corresponding checkbox.
- jQuery('#edit-query-options-disable-sql-rewrite').click(function () {
- jQuery('.sql-rewrite-warning').toggleClass('js-hide');
+ $('#edit-query-options-disable-sql-rewrite').click(function () {
+ $('.sql-rewrite-warning').toggleClass('js-hide');
});
};
@@ -27,10 +28,6 @@ Drupal.behaviors.viewsUiAddView = {};
* page title and menu link.
*/
Drupal.behaviors.viewsUiAddView.attach = function (context, settings) {
-
- "use strict";
-
- var $ = jQuery;
var exclude, replace, suffix;
// Set up regular expressions to allow only numbers, letters, and dashes.
exclude = new RegExp('[^a-z0-9\\-]+', 'g');
@@ -96,9 +93,6 @@ Drupal.behaviors.viewsUiAddView.attach = function (context, settings) {
*/
Drupal.viewsUi.FormFieldFiller = function ($target, exclude, replace, suffix) {
- "use strict";
-
- var $ = jQuery;
this.source = $('#edit-label');
this.target = $target;
this.exclude = exclude || false;
@@ -122,9 +116,6 @@ Drupal.viewsUi.FormFieldFiller = function ($target, exclude, replace, suffix) {
* Bind the form-filling behavior.
*/
Drupal.viewsUi.FormFieldFiller.prototype.bind = function () {
-
- "use strict";
-
this.unbind();
// Populate the form field when the source changes.
this.source.bind('keyup.viewsUi change.viewsUi', this.populate);
@@ -136,9 +127,6 @@ Drupal.viewsUi.FormFieldFiller.prototype.bind = function () {
* Get the source form field value as altered by the passed-in parameters.
*/
Drupal.viewsUi.FormFieldFiller.prototype.getTransliterated = function () {
-
- "use strict";
-
var from = this.source.val();
if (this.exclude) {
from = from.toLowerCase().replace(this.exclude, this.replace);
@@ -150,9 +138,6 @@ Drupal.viewsUi.FormFieldFiller.prototype.getTransliterated = function () {
* Populate the target form field with the altered source field value.
*/
Drupal.viewsUi.FormFieldFiller.prototype._populate = function () {
-
- "use strict";
-
var transliterated = this.getTransliterated();
this.target.val(transliterated);
};
@@ -161,9 +146,6 @@ Drupal.viewsUi.FormFieldFiller.prototype._populate = function () {
* Stop prepopulating the form fields.
*/
Drupal.viewsUi.FormFieldFiller.prototype._unbind = function () {
-
- "use strict";
-
this.source.unbind('keyup.viewsUi change.viewsUi', this.populate);
this.target.unbind('focus.viewsUi', this.unbind);
};
@@ -172,9 +154,6 @@ Drupal.viewsUi.FormFieldFiller.prototype._unbind = function () {
* Bind event handlers to the new form fields, after they're replaced via AJAX.
*/
Drupal.viewsUi.FormFieldFiller.prototype.rebind = function ($fields) {
-
- "use strict";
-
this.target = $fields;
this.bind();
};
@@ -182,9 +161,6 @@ Drupal.viewsUi.FormFieldFiller.prototype.rebind = function ($fields) {
Drupal.behaviors.addItemForm = {};
Drupal.behaviors.addItemForm.attach = function (context) {
- "use strict";
-
- var $ = jQuery;
// The add item form may have an id of views-ui-add-item-form--n.
var $form = $(context).find('form[id^="views-ui-add-item-form"]').first();
// Make sure we don't add more than one event handler to the same form.
@@ -195,11 +171,8 @@ Drupal.behaviors.addItemForm.attach = function (context) {
};
Drupal.viewsUi.addItemForm = function($form) {
-
- "use strict";
-
this.$form = $form;
- this.$form.find('.views-filterable-options :checkbox').click(jQuery.proxy(this.handleCheck, this));
+ this.$form.find('.views-filterable-options :checkbox').click($.proxy(this.handleCheck, this));
// Find the wrapper of the displayed text.
this.$selected_div = this.$form.find('.views-selected-options').parent();
this.$selected_div.hide();
@@ -207,11 +180,8 @@ Drupal.viewsUi.addItemForm = function($form) {
};
Drupal.viewsUi.addItemForm.prototype.handleCheck = function (event) {
-
- "use strict";
-
- var $target = jQuery(event.target);
- var label = jQuery.trim($target.next().text());
+ var $target = $(event.target);
+ var label = $.trim($target.next().text());
// Add/remove the checked item to the list.
if ($target.is(':checked')) {
this.$selected_div.show();
@@ -219,7 +189,7 @@ Drupal.viewsUi.addItemForm.prototype.handleCheck = function (event) {
}
else {
var length = this.checkedItems.length;
- var position = jQuery.inArray(label, this.checkedItems);
+ var position = $.inArray(label, this.checkedItems);
// Delete the item from the list and take sure that the list doesn't have undefined items left.
for (var i = 0; i < this.checkedItems.length; i++) {
if (i === position) {
@@ -240,12 +210,10 @@ Drupal.viewsUi.addItemForm.prototype.handleCheck = function (event) {
* Refresh the display of the checked items.
*/
Drupal.viewsUi.addItemForm.prototype.refreshCheckedItems = function() {
-
- "use strict";
-
// Perhaps we should precache the text div, too.
this.$selected_div.find('.views-selected-options').html(this.checkedItems.join(', '));
- Drupal.viewsUi.resizeModal('', true);
+ //var dialog = Drupal.dialog(this.$selected_div.closest('.ui-dialog-content'));
+ Drupal.viewsUi.resizeDialog(this.$selected_div.closest('.ui-widget-content'), true);
};
/**
@@ -257,9 +225,6 @@ Drupal.behaviors.viewsUiRenderAddViewButton = {};
Drupal.behaviors.viewsUiRenderAddViewButton.attach = function (context, settings) {
- "use strict";
-
- var $ = jQuery;
// Build the add display menu and pull the display input buttons into it.
var $menu = $('#views-display-menu-tabs', context).once('views-ui-render-add-view-button-processed');
@@ -309,9 +274,6 @@ Drupal.behaviors.viewsUiRenderAddViewButton.attach = function (context, settings
* not written specifically for this UI, but I'm not sure where to put it.
*/
Drupal.behaviors.viewsUiRenderAddViewButton.toggleMenu = function ($trigger) {
-
- "use strict";
-
$trigger.parent().toggleClass('open');
$trigger.next().slideToggle('fast');
};
@@ -320,9 +282,6 @@ Drupal.behaviors.viewsUiSearchOptions = {};
Drupal.behaviors.viewsUiSearchOptions.attach = function (context) {
- "use strict";
-
- var $ = jQuery;
// The add item form may have an id of views-ui-add-item-form--n.
var $form = $(context).find('form[id^="views-ui-add-item-form"]').first();
// Make sure we don't add more than one event handler to the same form.
@@ -340,13 +299,10 @@ Drupal.behaviors.viewsUiSearchOptions.attach = function (context) {
* containing "taxonomy" in their label.
*/
Drupal.viewsUi.OptionsSearch = function ($form) {
-
- "use strict";
-
this.$form = $form;
// Add a keyup handler to the search box.
this.$searchBox = this.$form.find('#edit-override-controls-options-search');
- this.$searchBox.keyup(jQuery.proxy(this.handleKeyup, this));
+ this.$searchBox.keyup($.proxy(this.handleKeyup, this));
// Get a list of option labels and their corresponding divs and maintain it
// in memory, so we have as little overhead as possible at keyup time.
this.options = this.getOptions(this.$form.find('.filterable-option'));
@@ -368,10 +324,6 @@ Drupal.viewsUi.OptionsSearch = function ($form) {
* shown and hidden depending on the user's search terms.
*/
Drupal.viewsUi.OptionsSearch.prototype.getOptions = function ($allOptions) {
-
- "use strict";
-
- var $ = jQuery;
var i, $label, $description, $option;
var options = [];
var length = $allOptions.length;
@@ -395,9 +347,6 @@ Drupal.viewsUi.OptionsSearch.prototype.getOptions = function ($allOptions) {
* Keyup handler for the search box that hides or shows the relevant options.
*/
Drupal.viewsUi.OptionsSearch.prototype.handleKeyup = function (event) {
-
- "use strict";
-
var found, i, j, option, search, words, wordsLength, zebraClass, zebraCounter;
// Determine the user's search query. The search text has been converted to
@@ -439,11 +388,6 @@ Drupal.viewsUi.OptionsSearch.prototype.handleKeyup = function (event) {
Drupal.behaviors.viewsUiPreview = {};
Drupal.behaviors.viewsUiPreview.attach = function (context, settings) {
-
- "use strict";
-
- var $ = jQuery;
-
// Only act on the edit view form.
var contextualFiltersBucket = $('.views-display-column .views-ui-display-tab-bucket.contextual-filters', context);
if (contextualFiltersBucket.length === 0) {
@@ -469,10 +413,6 @@ Drupal.behaviors.viewsUiPreview.attach = function (context, settings) {
Drupal.behaviors.viewsUiRearrangeFilter = {};
Drupal.behaviors.viewsUiRearrangeFilter.attach = function (context, settings) {
-
- "use strict";
-
- var $ = jQuery;
// Only act on the rearrange filter form.
if (typeof Drupal.tableDrag === 'undefined' || typeof Drupal.tableDrag['views-rearrange-filters'] === 'undefined') {
return;
@@ -489,10 +429,6 @@ Drupal.behaviors.viewsUiRearrangeFilter.attach = function (context, settings) {
* Improve the UI of the rearrange filters dialog box.
*/
Drupal.viewsUi.rearrangeFilterHandler = function (table, operator) {
-
- "use strict";
-
- var $ = jQuery;
// Keep a reference to the
being altered and to the div containing
// the filter groups operator dropdown (if it exists).
this.table = table;
@@ -547,11 +483,6 @@ Drupal.viewsUi.rearrangeFilterHandler = function (table, operator) {
* Insert links that allow filter groups to be added and removed.
*/
Drupal.viewsUi.rearrangeFilterHandler.prototype.insertAddRemoveFilterGroupLinks = function () {
-
- "use strict";
-
- var $ = jQuery;
-
// Insert a link for adding a new group at the top of the page, and make it
// match the action links styling used in a typical page.tpl.php. Note that
// Drupal does not provide a theme function for this markup, so this is the
@@ -583,9 +514,6 @@ Drupal.viewsUi.rearrangeFilterHandler.prototype.insertAddRemoveFilterGroupLinks
* Dynamically click the button that adds a new filter group.
*/
Drupal.viewsUi.rearrangeFilterHandler.prototype.clickAddGroupButton = function () {
-
- "use strict";
-
// Due to conflicts between Drupal core's AJAX system and the Views AJAX
// system, the only way to get this to work seems to be to trigger both the
// .mousedown() and .submit() events.
@@ -602,13 +530,10 @@ Drupal.viewsUi.rearrangeFilterHandler.prototype.clickAddGroupButton = function (
* form button that should be clicked.
*/
Drupal.viewsUi.rearrangeFilterHandler.prototype.clickRemoveGroupButton = function (event) {
-
- "use strict";
-
// For some reason, here we only need to trigger .submit(), unlike for
// Drupal.viewsUi.rearrangeFilterHandler.prototype.clickAddGroupButton()
// where we had to trigger .mousedown() also.
- jQuery('input#' + event.data.buttonId, this.table).submit();
+ $('input#' + event.data.buttonId, this.table).submit();
event.preventDefault();
};
@@ -617,10 +542,6 @@ Drupal.viewsUi.rearrangeFilterHandler.prototype.clickRemoveGroupButton = functio
* duplicate it between any subsequent groups.
*/
Drupal.viewsUi.rearrangeFilterHandler.prototype.duplicateGroupsOperator = function () {
-
- "use strict";
-
- var $ = jQuery;
var dropdowns, newRow;
var titleRows = $('tr.views-group-title'), titleRow;
@@ -659,15 +580,12 @@ Drupal.viewsUi.rearrangeFilterHandler.prototype.duplicateGroupsOperator = functi
* Make the duplicated groups operators change in sync with each other.
*/
Drupal.viewsUi.rearrangeFilterHandler.prototype.syncGroupsOperators = function () {
-
- "use strict";
-
if (this.dropdowns.length < 2) {
// We only have one dropdown (or none at all), so there's nothing to sync.
return;
}
- this.dropdowns.change(jQuery.proxy(this, 'operatorChangeHandler'));
+ this.dropdowns.change($.proxy(this, 'operatorChangeHandler'));
};
/**
@@ -676,10 +594,6 @@ Drupal.viewsUi.rearrangeFilterHandler.prototype.syncGroupsOperators = function (
* Forces all operator dropdowns to have the same value.
*/
Drupal.viewsUi.rearrangeFilterHandler.prototype.operatorChangeHandler = function (event) {
-
- "use strict";
-
- var $ = jQuery;
var $target = $(event.target);
var operators = this.dropdowns.find('select').not($target);
@@ -688,9 +602,6 @@ Drupal.viewsUi.rearrangeFilterHandler.prototype.operatorChangeHandler = function
};
Drupal.viewsUi.rearrangeFilterHandler.prototype.modifyTableDrag = function () {
-
- "use strict";
-
var tableDrag = Drupal.tableDrag['views-rearrange-filters'];
var filterHandler = this;
@@ -710,7 +621,7 @@ Drupal.viewsUi.rearrangeFilterHandler.prototype.modifyTableDrag = function () {
// Make sure the row that just got moved (this.group) is inside one of
// the filter groups (i.e. below an empty marker row or a draggable). If
// it isn't, move it down one.
- var thisRow = jQuery(this.group);
+ var thisRow = $(this.group);
var previousRow = thisRow.prev('tr');
if (previousRow.length && !previousRow.hasClass('group-message') && !previousRow.hasClass('draggable')) {
// Move the dragged row down one.
@@ -730,8 +641,6 @@ Drupal.viewsUi.rearrangeFilterHandler.prototype.modifyTableDrag = function () {
* Override the onDrop method from tabledrag.js.
*/
tableDrag.onDrop = function () {
- var $ = jQuery;
-
// If the tabledrag change marker (i.e., the "*") has been inserted inside
// a row after the operator label (i.e., "And" or "Or") rearrange the items
// so the operator label continues to appear last.
@@ -763,10 +672,6 @@ Drupal.viewsUi.rearrangeFilterHandler.prototype.modifyTableDrag = function () {
* Redraw the operator labels that are displayed next to each filter.
*/
Drupal.viewsUi.rearrangeFilterHandler.prototype.redrawOperatorLabels = function () {
-
- "use strict";
-
- var $ = jQuery;
var i;
for (i = 0; i < this.draggableRows.length; i++) {
// Within the row, the operator labels are displayed inside the first table
@@ -812,10 +717,6 @@ Drupal.viewsUi.rearrangeFilterHandler.prototype.redrawOperatorLabels = function
* Update the rowspan attribute of each cell containing an operator dropdown.
*/
Drupal.viewsUi.rearrangeFilterHandler.prototype.updateRowspans = function () {
-
- "use strict";
-
- var $ = jQuery;
var i, $row, $currentEmptyRow, draggableCount, $operatorCell;
var rows = $(this.table).find('tr');
var length = rows.length;
@@ -849,10 +750,6 @@ Drupal.behaviors.viewsFilterConfigSelectAll = {};
* Add a select all checkbox, which checks each checkbox at once.
*/
Drupal.behaviors.viewsFilterConfigSelectAll.attach = function(context) {
-
- "use strict";
-
- var $ = jQuery;
// Show the select all checkbox.
$('#views-ui-config-item-form div.form-item-options-value-all', context).once(function() {
$(this).show();
@@ -880,11 +777,8 @@ Drupal.behaviors.viewsFilterConfigSelectAll.attach = function(context) {
*/
Drupal.behaviors.viewsRemoveIconClass = {};
Drupal.behaviors.viewsRemoveIconClass.attach = function (context, settings) {
-
- "use strict";
-
- jQuery(context).find('.dropbutton').once('dropbutton-icon', function () {
- jQuery(this).find('.icon').removeClass('icon');
+ $(context).find('.dropbutton').once('dropbutton-icon', function () {
+ $(this).find('.icon').removeClass('icon');
});
};
@@ -893,10 +787,6 @@ Drupal.behaviors.viewsRemoveIconClass.attach = function (context, settings) {
*/
Drupal.behaviors.viewsUiCheckboxify = {};
Drupal.behaviors.viewsUiCheckboxify.attach = function (context, settings) {
-
- "use strict";
-
- var $ = jQuery;
var $buttons = $('#edit-options-expose-button-button, #edit-options-group-button-button').once('views-ui-checkboxify');
var length = $buttons.length;
var i;
@@ -911,10 +801,6 @@ Drupal.behaviors.viewsUiCheckboxify.attach = function (context, settings) {
*/
Drupal.behaviors.viewsUiChangeDefaultWidget = {};
Drupal.behaviors.viewsUiChangeDefaultWidget.attach = function (context, settings) {
-
- "use strict";
-
- var $ = jQuery;
function change_default_widget(multiple) {
if (multiple) {
$('input.default-radios').hide();
@@ -942,10 +828,6 @@ Drupal.behaviors.viewsUiChangeDefaultWidget.attach = function (context, settings
* The DOM object representing the button to be checkboxified.
*/
Drupal.viewsUi.Checkboxifier = function (button) {
-
- "use strict";
-
- var $ = jQuery;
this.$button = $(button);
this.$parent = this.$button.parent('div.views-expose, div.views-grouped');
this.$input = this.$parent.find('input:checkbox, input:radio');
@@ -961,9 +843,6 @@ Drupal.viewsUi.Checkboxifier = function (button) {
* When the checkbox is checked or unchecked, simulate a button press.
*/
Drupal.viewsUi.Checkboxifier.prototype.clickHandler = function (e) {
-
- "use strict";
-
this.$button.mousedown();
this.$button.submit();
};
@@ -973,10 +852,6 @@ Drupal.viewsUi.Checkboxifier.prototype.clickHandler = function (e) {
*/
Drupal.behaviors.viewsUiOverrideSelect = {};
Drupal.behaviors.viewsUiOverrideSelect.attach = function (context, settings) {
-
- "use strict";
-
- var $ = jQuery;
$('#edit-override-dropdown', context).once('views-ui-override-button-text', function() {
// Closures! :(
var $submit = $('#edit-submit', context);
@@ -1004,30 +879,22 @@ Drupal.behaviors.viewsUiOverrideSelect.attach = function (context, settings) {
};
-Drupal.viewsUi.resizeModal = function (e, no_shrink) {
+Drupal.viewsUi.resizeModal = function (dialog, noShrink) {
+ var $modal = $(dialog.element);
+ var $scroll = $modal.find('.scroll');
- "use strict";
+ // Don't let the window get more than 80% of the display high.
+ var maxHeight = parseInt($(window).height() * .80);
- var $ = jQuery;
- var $modal = $('.views-ui-dialog');
- var $scroll = $('.scroll', $modal);
- if ($modal.size() === 0 || $modal.css('display') === 'none') {
- return;
+ // Remove any toolbar padding.
+ var offsetHeight = $('#toolbar-administration').data('offset-top');
+ if (offsetHeight) {
+ maxHeight -= offsetHeight;
}
- var maxWidth = parseInt($(window).width() * .85); // 70% of window
- var minWidth = parseInt($(window).width() * .6); // 70% of window
-
- // Set the modal to the minwidth so that our width calculation of
- // children works.
- $modal.css('width', minWidth);
- var width = minWidth;
-
- // Don't let the window get more than 80% of the display high.
- var maxHeight = parseInt($(window).height() * .8);
var minHeight = 200;
- if (no_shrink) {
- minHeight = $modal.height();
+ if (noShrink) {
+ minHeight = $modal.parent().height();
}
if (minHeight > maxHeight) {
@@ -1043,10 +910,6 @@ Drupal.viewsUi.resizeModal = function (e, no_shrink) {
scrollHeight += parseInt($scroll.css('padding-bottom'));
$scroll.children().each(function() {
- var w = $(this).innerWidth();
- if (w > width) {
- width = w;
- }
scrollHeight += $(this).outerHeight(true);
});
@@ -1060,7 +923,6 @@ Drupal.viewsUi.resizeModal = function (e, no_shrink) {
difference += $('.views-messages').outerHeight(true);
difference += $('#views-ajax-title').outerHeight(true);
difference += $('.views-add-form-selected').outerHeight(true);
- difference += $('.form-buttons', $modal).outerHeight(true);
height = scrollHeight + difference;
@@ -1073,29 +935,16 @@ Drupal.viewsUi.resizeModal = function (e, no_shrink) {
scrollHeight = minHeight - difference;
}
- if (width > maxWidth) {
- width = maxWidth;
- }
-
- // Get where we should move content to
- var top = ($(window).height() / 2) - (height / 2);
- var left = ($(window).width() / 2) - (width / 2);
-
- $modal.css({
- 'top': top + 'px',
- 'left': left + 'px',
- 'width': width + 'px',
- 'height': height + 'px'
- });
-
// Ensure inner popup height matches.
- $(Drupal.settings.views.ajax.popup).css('height', height + 'px');
+ $modal.css('height', height + 'px');
$scroll.css({
'height': scrollHeight + 'px',
'max-height': scrollHeight + 'px'
});
+ // Recenter the dialog.
+ $modal.dialog('option', 'position', 'center');
};
Drupal.behaviors.viewsUiHandlerRemoveLink = {};
@@ -1122,10 +971,13 @@ Drupal.behaviors.viewsUiHandlerRemoveLink.attach = function(context) {
};
-jQuery(function() {
-
- "use strict"
-
- jQuery(window).bind('resize', Drupal.viewsUi.resizeModal);
- jQuery(window).bind('scroll', Drupal.viewsUi.resizeModal);
+$(window).on('dialog:aftercreate', function(e, dialog, $element) {
+ $(window).on('resize.dialogResize scroll.dialogResize', function(e) {
+ Drupal.viewsUi.resizeModal($element);
+ });
+});
+$(window).on('dialog:afterclose', function() {
+ $(window).off('resize.dialogResize scroll.dialogResize');
});
+
+})(jQuery);
diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/AddItem.php b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/AddItem.php
index 1c8d13e..92d1397 100644
--- a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/AddItem.php
+++ b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/AddItem.php
@@ -176,10 +176,10 @@ public function buildForm(array $form, array &$form_state) {
$view->getStandardButtons($form, $form_state, 'views_ui_add_item_form', t('Add and configure @types', array('@types' => $ltitle)));
// Remove the default submit function.
- $form['buttons']['submit']['#submit'] = array_filter($form['buttons']['submit']['#submit'], function($var) {
+ $form['actions']['submit']['#submit'] = array_filter($form['buttons']['submit']['#submit'], function($var) {
return !(is_array($var) && isset($var[1]) && $var[1] == 'standardSubmit');
});
- $form['buttons']['submit']['#submit'][] = array($view, 'submitItemAdd');
+ $form['actions']['submit']['#submit'][] = array($view, 'submitItemAdd');
return $form;
}
diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigItem.php b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigItem.php
index b047507..c6e3dc2 100644
--- a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigItem.php
+++ b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigItem.php
@@ -169,11 +169,14 @@ public function buildForm(array $form, array &$form_state) {
$view->getStandardButtons($form, $form_state, 'views_ui_config_item_form', $name);
// Add a 'remove' button.
- $form['buttons']['remove'] = array(
+ $form['actions']['remove'] = array(
'#type' => 'submit',
'#value' => t('Remove'),
'#submit' => array(array($this, 'remove')),
'#limit_validation_errors' => array(array('override')),
+ '#ajax' => array(
+ 'path' => current_path(),
+ ),
);
}
diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/RearrangeFilter.php b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/RearrangeFilter.php
index e49cc96..abe3706 100644
--- a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/RearrangeFilter.php
+++ b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/RearrangeFilter.php
@@ -197,7 +197,7 @@ public function buildForm(array $form, array &$form_state) {
}
$view->getStandardButtons($form, $form_state, 'views_ui_rearrange_filter_form');
- $form['buttons']['add_group'] = array(
+ $form['actions']['add_group'] = array(
'#type' => 'submit',
'#value' => t('Create new filter group'),
'#id' => 'views-add-group',
diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ViewsFormBase.php b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ViewsFormBase.php
index 3b75a36..51e5d09 100644
--- a/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ViewsFormBase.php
+++ b/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ViewsFormBase.php
@@ -11,6 +11,7 @@
use Drupal\views\ViewStorageInterface;
use Drupal\views\Ajax;
use Drupal\Core\Ajax\AjaxResponse;
+use Drupal\Core\Ajax\CloseModalDialogCommand;
use Symfony\Component\HttpFoundation\RedirectResponse;
/**
@@ -144,11 +145,11 @@ public function getForm(ViewStorageInterface $view, $display_id, $js) {
$form_state = $reflection->newInstanceArgs(array_slice($top, 3, 2))->getFormState($view, $top[2], $form_state['ajax']);
$form_state['input'] = array();
- $form_url = views_ui_build_form_url($form_state);
+ $form_path = views_ui_build_form_path($form_state);
if (!$form_state['ajax']) {
- return new RedirectResponse(url($form_url, array('absolute' => TRUE)));
+ return new RedirectResponse(url($form_path, array('absolute' => TRUE)));
}
- $form_state['url'] = url($form_url);
+ $form_state['path'] = $form_path;
$response = views_ajax_form_wrapper($form_state['form_id'], $form_state);
}
elseif (!$form_state['ajax']) {
@@ -157,7 +158,7 @@ public function getForm(ViewStorageInterface $view, $display_id, $js) {
}
else {
$response = new AjaxResponse();
- $response->addCommand(new Ajax\DismissFormCommand());
+ $response->addCommand(new CloseModalDialogCommand());
$response->addCommand(new Ajax\ShowButtonsCommand());
$response->addCommand(new Ajax\TriggerPreviewCommand());
if (!empty($form_state['#page_title'])) {
diff --git a/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php b/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php
index 3606a71..58e2be5 100644
--- a/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php
+++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php
@@ -89,8 +89,6 @@ public function form(array $form, array &$form_state) {
$form['#tree'] = TRUE;
- $form['#attached']['library'][] = array('system', 'jquery.ui.tabs');
- $form['#attached']['library'][] = array('system', 'jquery.ui.dialog');
$form['#attached']['library'][] = array('system', 'drupal.states');
$form['#attached']['library'][] = array('system', 'drupal.tabledrag');
@@ -100,16 +98,6 @@ public function form(array $form, array &$form_state) {
$form['#attached']['css'] = static::getAdminCSS();
- $form['#attached']['js'][] = array(
- 'data' => array('views' => array('ajax' => array(
- 'id' => '#views-ajax-body',
- 'title' => '#views-ajax-title',
- 'popup' => '#views-ajax-popup',
- 'defaultForm' => $view->getDefaultAJAXMessage(),
- ))),
- 'type' => 'setting',
- );
-
$form += array(
'#prefix' => '',
'#suffix' => '',
diff --git a/core/modules/views_ui/lib/Drupal/views_ui/ViewUI.php b/core/modules/views_ui/lib/Drupal/views_ui/ViewUI.php
index 5877f28..c65fea9 100644
--- a/core/modules/views_ui/lib/Drupal/views_ui/ViewUI.php
+++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewUI.php
@@ -266,9 +266,8 @@ public function standardCancel($form, &$form_state) {
* docblock outdated?
*/
public function getStandardButtons(&$form, &$form_state, $form_id, $name = NULL) {
- $form['buttons'] = array(
- '#prefix' => '',
+ $form['actions'] = array(
+ '#type' => 'actions',
);
if (empty($name)) {
@@ -279,10 +278,15 @@ public function getStandardButtons(&$form, &$form_state, $form_id, $name = NULL)
$names = array(t('Apply'), t('Apply and continue'));
}
+ // Views provides its own custom handling of AJAX form submissions. Usually
+ // this happens at the same path, but custom paths may be specified in
+ // $form_state.
+ $form_path = empty($form_state['path']) ? current_path() : $form_state['path'];
+
// Forms that are purely informational set an ok_button flag, so we know not
// to create an "Apply" button for them.
if (empty($form_state['ok_button'])) {
- $form['buttons']['submit'] = array(
+ $form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => $name,
// The regular submit handler ($form_id . '_submit') does not apply if
@@ -292,6 +296,9 @@ public function getStandardButtons(&$form, &$form_state, $form_id, $name = NULL)
// take care of running the regular submit handler as appropriate.
'#submit' => array(array($this, 'standardSubmit')),
'#button_type' => 'primary',
+ '#ajax' => array(
+ 'path' => $form_path,
+ ),
);
// Form API button click detection requires the button's #value to be the
// same between the form build of the initial page request, and the
@@ -303,25 +310,28 @@ public function getStandardButtons(&$form, &$form_state, $form_id, $name = NULL)
// extending button click detection code to support any of the possible
// button labels.
if (isset($names)) {
- $form['buttons']['submit']['#values'] = $names;
- $form['buttons']['submit']['#process'] = array_merge(array('views_ui_form_button_was_clicked'), element_info_property($form['buttons']['submit']['#type'], '#process', array()));
+ $form['actions']['submit']['#values'] = $names;
+ $form['actions']['submit']['#process'] = array_merge(array('views_ui_form_button_was_clicked'), element_info_property($form['actions']['submit']['#type'], '#process', array()));
}
// If a validation handler exists for the form, assign it to this button.
if (isset($form_state['build_info']['callback_object'])) {
- $form['buttons']['submit']['#validate'][] = array($form_state['build_info']['callback_object'], 'validateForm');
+ $form['actions']['submit']['#validate'][] = array($form_state['build_info']['callback_object'], 'validateForm');
}
if (function_exists($form_id . '_validate')) {
- $form['buttons']['submit']['#validate'][] = $form_id . '_validate';
+ $form['actions']['submit']['#validate'][] = $form_id . '_validate';
}
}
// Create a "Cancel" button. For purely informational forms, label it "OK".
$cancel_submit = function_exists($form_id . '_cancel') ? $form_id . '_cancel' : array($this, 'standardCancel');
- $form['buttons']['cancel'] = array(
+ $form['actions']['cancel'] = array(
'#type' => 'submit',
'#value' => empty($form_state['ok_button']) ? t('Cancel') : t('Ok'),
'#submit' => array($cancel_submit),
'#validate' => array(),
+ '#ajax' => array(
+ 'path' => $form_path,
+ ),
'#attributes' => array('formnovalidate' => ''),
);
@@ -330,9 +340,6 @@ public function getStandardButtons(&$form, &$form_state, $form_id, $name = NULL)
if (isset($form['#title'])) {
$form_state['title'] = $form['#title'];
}
- if (isset($form['#url'])) {
- $form_state['url'] = $form['#url'];
- }
if (isset($form['#section'])) {
$form_state['#section'] = $form['#section'];
}
diff --git a/core/modules/views_ui/views_ui.theme.inc b/core/modules/views_ui/views_ui.theme.inc
index a0a2630..4a7793f 100644
--- a/core/modules/views_ui/views_ui.theme.inc
+++ b/core/modules/views_ui/views_ui.theme.inc
@@ -304,7 +304,7 @@ function theme_views_ui_rearrange_filter_form(&$vars) {
// When JavaScript is enabled, the button for adding a new group should be
// hidden, since it will be replaced by a link on the client side.
- $form['buttons']['add_group']['#attributes']['class'][] = 'js-hide';
+ $form['actions']['add_group']['#attributes']['class'][] = 'js-hide';
// Render the rest of the form and return.
$output .= drupal_render_children($form);
diff --git a/core/themes/bartik/css/style.css b/core/themes/bartik/css/style.css
index 9c65ea3..cf05b76 100644
--- a/core/themes/bartik/css/style.css
+++ b/core/themes/bartik/css/style.css
@@ -1702,19 +1702,19 @@ div.admin-panel .description {
background-color: #F9F9F9;
}
-.views-ui-dialog .ui-dialog-titlebar-close,
-.views-ui-dialog #views-ajax-title,
-.views-ui-dialog .views-override,
-.views-ui-dialog .form-buttons {
+.ui-dialog .ui-dialog-titlebar-close,
+.ui-dialog #views-ajax-title,
+.ui-dialog .views-override,
+.ui-dialog .form-actions {
background-color: #f6f6f6;
}
-.views-ui-dialog a {
+.ui-dialog a {
color: #0071b3;
}
-.views-ui-dialog a:hover,
-.views-ui-dialog a:focus {
+.ui-dialog a:hover,
+.ui-dialog a:focus {
color: #018fe2;
}
diff --git a/core/themes/seven/jquery.ui.theme.css b/core/themes/seven/jquery.ui.theme.css
index ee72497..741a4b5 100644
--- a/core/themes/seven/jquery.ui.theme.css
+++ b/core/themes/seven/jquery.ui.theme.css
@@ -332,61 +332,6 @@
}
/**
- * Dialogs
- */
-.ui-dialog {
- background: #fff;
- border: solid 1px #ccc;
- padding: 0;
-}
-.ui-dialog .ui-dialog-titlebar {
- font-weight: bold;
- background: #e1e2dc;
-}
-.ui-dialog .ui-dialog-buttonpane {
- border-width: 0;
-}
-.ui-dialog .ui-dialog-buttonpane button {
- cursor: pointer;
- padding: 4px 17px;
- color: #5a5a5a;
- text-align: center;
- font-family: "Lucida Grande", Verdana, sans-serif;
- font-weight: normal;
- font-size: 1em;
- border: 1px solid #e4e4e4;
- border-bottom: 1px solid #b4b4b4;
- border-left-color: #D2D2D2;
- border-right-color: #D2D2D2;
- background: url(images/buttons.png) 0 0 repeat-x;
- border-radius: 20px;
-}
-.ui-dialog .ui-dialog-buttonpane button:hover,
-.ui-dialog .ui-dialog-buttonpane button:focus {
- background-position: 0 -40px;
- border: 1px solid #bebebe;
- border-left-color: #afafaf;
- border-right-color: #afafaf;
- border-bottom-color: #9b9b9b;
- color: #2e2e2e;
-}
-.ui-dialog .ui-dialog-buttonpane button:active {
- background-position: 0 -80px;
- border: 1px solid #333;
- border-left-color: #222;
- border-right-color: #222;
- border-bottom-color: #111;
- color: #fff;
- text-shadow: #222 0px -1px 0px;
-}
-.overlay {
- padding-right: 26px;
-}
-.overlay .ui-dialog-titlebar {
- background: transparent;
-}
-
-/**
* Slider
*/
.ui-slider {
diff --git a/core/themes/seven/style.css b/core/themes/seven/style.css
index 4dfa8b4..c9cfc2e 100644
--- a/core/themes/seven/style.css
+++ b/core/themes/seven/style.css
@@ -1453,23 +1453,7 @@ details.fieldset-no-legend {
/* @end */
-/* @group Modal dialog box
- *
- * The contents of the popup dialog on the views edit form.
- */
-
-.views-ui-dialog .ui-dialog-titlebar-close {
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
- border-color: #cccccc;
- right: -27px;
- top: -1px;
-}
-
-.views-ui-dialog details:not(.collapsed) {
- padding-top: 1.5em;
-}
+/* @group Views configuration. */
.filterable-option .form-item.form-type-checkbox {
/* This selector is aggressive because Seven's reset for .form-items is aggressive. */