Commit f140bcee authored by alexpott's avatar alexpott

Issue #1904932 by dawehner, damiankloip, YesCT: Fixed Cannot remove a handler...

Issue #1904932 by dawehner, damiankloip, YesCT: Fixed Cannot remove a handler from the 'rearrange' popup.
parent 1304f13b
......@@ -1098,6 +1098,30 @@ Drupal.viewsUi.resizeModal = function (e, no_shrink) {
};
Drupal.behaviors.viewsUiHandlerRemoveLink = {};
Drupal.behaviors.viewsUiHandlerRemoveLink.attach = function(context) {
var $ = jQuery;
// Handle handler deletion by looking for the hidden checkbox and hiding the
// row.
$('a.views-remove-link', context).once('views-processed').click(function(event) {
var id = $(this).attr('id').replace('views-remove-link-', '');
$('#views-row-' + id, context).hide();
$('#views-removed-' + id, context).attr('checked', true);
event.preventDefault();
});
// Handle display deletion by looking for the hidden checkbox and hiding the
// row.
$('a.display-remove-link', context).once('display').click(function(event) {
var id = $(this).attr('id').replace('display-remove-link-', '');
$('#display-row-' + id, context).hide();
$('#display-removed-' + id, context).attr('checked', true);
event.preventDefault();
});
};
jQuery(function() {
"use strict"
......
......@@ -289,7 +289,7 @@ function theme_views_ui_rearrange_filter_form(&$vars) {
$form['filters'][$id]['group']['#attributes']['class'] = array('views-group-select views-group-select-' . $group_id);
$row[] = drupal_render($form['filters'][$id]['group']);
$form['filters'][$id]['removed']['#attributes']['class'][] = 'js-hide';
$row[] = drupal_render($form['filters'][$id]['removed']) . l('<span>' . t('Remove') . '</span>', 'javascript:void()', array('attributes' => array('id' => 'views-remove-link-' . $id, 'class' => array('views-hidden', 'views-button-remove', 'views-groups-remove-link', 'views-remove-link'), 'alt' => t('Remove this item'), 'title' => t('Remove this item')), 'html' => TRUE));
$row[] = drupal_render($form['filters'][$id]['removed']) . l('<span>' . t('Remove') . '</span>', '', array('attributes' => array('id' => 'views-remove-link-' . $id, 'class' => array('views-hidden', 'views-button-remove', 'views-groups-remove-link', 'views-remove-link'), 'alt' => t('Remove this item'), 'title' => t('Remove this item')), 'html' => TRUE));
$row = array('data' => $row, 'class' => array('draggable'), 'id' => 'views-row-' . $id);
if ($group_id !== 'ungroupable') {
......
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