mirror of
https://github.com/processwire/processwire.git
synced 2025-08-12 09:44:38 +02:00
Fix issue processwire/processwire-issues#1025
This commit is contained in:
@@ -17,7 +17,7 @@ class InputfieldAsmSelect extends InputfieldSelectMultiple implements Inputfield
|
|||||||
public static function getModuleInfo() {
|
public static function getModuleInfo() {
|
||||||
return array(
|
return array(
|
||||||
'title' => __('asmSelect', __FILE__),
|
'title' => __('asmSelect', __FILE__),
|
||||||
'version' => 201,
|
'version' => 202,
|
||||||
'summary' => __('Multiple selection, progressive enhancement to select multiple', __FILE__), // Module Summary
|
'summary' => __('Multiple selection, progressive enhancement to select multiple', __FILE__), // Module Summary
|
||||||
'permanent' => true,
|
'permanent' => true,
|
||||||
);
|
);
|
||||||
|
@@ -185,22 +185,27 @@
|
|||||||
|
|
||||||
var fieldsetItems = [];
|
var fieldsetItems = [];
|
||||||
|
|
||||||
|
var sortableUpdate = function($ul, e, data) {
|
||||||
|
var $option = $('#' + data.item.attr('rel'));
|
||||||
|
var updatedOptionId = $option.attr('id');
|
||||||
|
|
||||||
|
$ul.children("li").each(function(n) {
|
||||||
|
$option = $('#' + $(this).attr('rel'));
|
||||||
|
$original.append($option);
|
||||||
|
});
|
||||||
|
|
||||||
|
if(updatedOptionId) {
|
||||||
|
triggerOriginalChange(updatedOptionId, 'sort');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$ol.sortable({
|
$ol.sortable({
|
||||||
items: 'li.' + options.listItemClass,
|
items: 'li.' + options.listItemClass,
|
||||||
axis: 'y',
|
axis: 'y',
|
||||||
cancel: 'a.asmEditLinkModalLongclick',
|
cancel: 'a.asmEditLinkModalLongclick',
|
||||||
update: function(e, ui) {
|
update: function(e, data) {
|
||||||
|
if(data.item.hasClass('asmFieldsetStart')) return;
|
||||||
var updatedOptionId;
|
sortableUpdate(jQuery(this), e, data);
|
||||||
$option = $('#' + ui.item.attr('rel'));
|
|
||||||
updatedOptionId = $option.attr('id');
|
|
||||||
|
|
||||||
$(this).children("li").each(function(n) {
|
|
||||||
$option = $('#' + $(this).attr('rel'));
|
|
||||||
$original.append($option);
|
|
||||||
});
|
|
||||||
|
|
||||||
if(updatedOptionId) triggerOriginalChange(updatedOptionId, 'sort');
|
|
||||||
},
|
},
|
||||||
start: function(e, data) {
|
start: function(e, data) {
|
||||||
if(options.jQueryUI) data.item.addClass('ui-state-highlight');
|
if(options.jQueryUI) data.item.addClass('ui-state-highlight');
|
||||||
@@ -229,8 +234,11 @@
|
|||||||
$item.slideDown('fast').fadeTo('fast', 1.0);
|
$item.slideDown('fast').fadeTo('fast', 1.0);
|
||||||
}
|
}
|
||||||
fieldsetItems = [];
|
fieldsetItems = [];
|
||||||
|
setupFieldsets();
|
||||||
|
sortableUpdate(jQuery(this), e, data);
|
||||||
|
} else {
|
||||||
|
setupFieldsets();
|
||||||
}
|
}
|
||||||
setupFieldsets();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}).addClass(options.listSortableClass);
|
}).addClass(options.listSortableClass);
|
||||||
|
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user