Skip to content

Instantly share code, notes, and snippets.

View zergius-eggstream's full-sized avatar

Zergius Eggstream zergius-eggstream

View GitHub Profile
@zergius-eggstream
zergius-eggstream / shift-selectable.js
Created March 13, 2017 10:08
jQuery plugin for shift + click to select multiple checkboxes (https://gist.github.com/AndrewRayCode/3784055 modified for live collections support)
// usage: $('.container').shiftSelectable() to select all checkboxes in container $('.cont')
// or $('.container').shiftSelectable({items: '.shift-selectable'}) to select only checkboxes with shift-selectable class
$.fn.shiftSelectable = function(config) {
config = $.extend({
items: 'input[type="checkbox"]'
}, config);
var $container = this;
var lastChecked;
$container.on('click', config.items, function(evt) {
https://www.google.com/search?q=lua+regex+match