Commit b63cb663 authored by Jorge Niedbalski's avatar Jorge Niedbalski

Modified click and touchstart events to support shift key event , not is...

Modified click and touchstart events to support shift key event , not is possible to multiselect values keeping shift pressed
parent 1b3a01d1
...@@ -283,6 +283,34 @@ ...@@ -283,6 +283,34 @@
$('li a', this.$ul).on('touchstart click', function(event) { $('li a', this.$ul).on('touchstart click', function(event) {
event.stopPropagation(); event.stopPropagation();
if ( event.shiftKey) {
var checked = $(event.target).prop('checked') || false;
if ( checked ) {
var prev = $(event.target).parents('li:last')
.siblings('li[class="active"]:first');
var currentIdx = $(event.target).parents('li').index(),
prevIdx = prev.index();
if ( currentIdx > prevIdx ) {
$(event.target).parents("li:last").prevUntil(prev).each(
function() {
$(this).find("input:first").prop("checked", true).trigger("change");
}
);
} else {
$(event.target).parents("li:last").nextUntil(prev).each(
function() {
$(this).find("input:first").prop("checked", true).trigger("change");
}
);
}
}
}
$(event.target).blur(); $(event.target).blur();
}); });
......
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