Commit 2a1be40e authored by David Stutz's avatar David Stutz

Merge pull request #185 from niedbalski/master

Modified click and touchstart events to support shift key multi selection.
parents 50374b12 b63cb663
......@@ -290,6 +290,34 @@
$('li a', this.$ul).on('touchstart click', function(event) {
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();
});
......
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