Issue #1764976 by nod_: Fixed views-list.js.
parent
5c18e68946
commit
0e97213792
|
@ -2,21 +2,31 @@
|
||||||
* @file
|
* @file
|
||||||
* Javascript related to the main view list.
|
* Javascript related to the main view list.
|
||||||
*/
|
*/
|
||||||
(function ($) {
|
(function ($, Drupal) {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
Drupal.behaviors.viewsUIList = {
|
Drupal.behaviors.viewsUIList = {
|
||||||
attach: function (context) {
|
attach: function () {
|
||||||
$('#ctools-export-ui-list-items thead a').once('views-ajax-processed').each(function() {
|
var $itemsTable = $('#ctools-export-ui-list-items thead').once('views-ajax-processed');
|
||||||
$(this).click(function() {
|
var $itemsForm = $('#ctools-export-ui-list-form');
|
||||||
|
if ($itemsTable.length) {
|
||||||
|
$itemsTable.on('click', 'a', function (e) {
|
||||||
|
e.preventDefault();
|
||||||
var query = $.deparam.querystring(this.href);
|
var query = $.deparam.querystring(this.href);
|
||||||
$('#ctools-export-ui-list-form select[name=order]').val(query.order);
|
$itemsForm.find('select[name=order]').val(query.order);
|
||||||
$('#ctools-export-ui-list-form select[name=sort]').val(query.sort);
|
$itemsForm.find('select[name=sort]').val(query.sort);
|
||||||
$('#ctools-export-ui-list-form input.ctools-auto-submit-click').trigger('click');
|
$itemsForm.find('input.ctools-auto-submit-click').trigger('click');
|
||||||
event.preventDefault();
|
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
|
},
|
||||||
|
detach: function (context, settings, trigger) {
|
||||||
|
if (trigger === 'unload') {
|
||||||
|
var $itemsTable = $('#ctools-export-ui-list-items thead').removeOnce('views-ajax-processed');
|
||||||
|
if ($itemsTable.length) {
|
||||||
|
$itemsTable.off('click');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue