Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checkbox range selection #426

Closed
Ivorius opened this Issue Dec 7, 2016 · 2 comments

Comments

3 participants
@Ivorius
Copy link
Contributor

Ivorius commented Dec 7, 2016

Something like

	$.fn.enableCheckboxRangeSelection = function() {
		var lastCheckbox = null;
		var lastElement = null;

		var $spec = this;
		$spec.bind("click", function(e) {
			if (lastCheckbox != null && e.shiftKey) {
				$spec.slice(
						Math.min($spec.index(lastCheckbox), $spec.index(e.target)),
						Math.max($spec.index(lastCheckbox), $spec.index(e.target)) + 1
						).attr({
					checked: e.target.checked ? "checked" : ""
				});
			}
			lastCheckbox = e.target;
		});

	};
@juniwalk

This comment has been minimized.

Copy link
Collaborator

juniwalk commented Dec 7, 2016

Hello @Ivorius, thanks for the suggestion. I'll leave that for @paveljanda to check it out.

@paveljanda

This comment has been minimized.

Copy link
Member

paveljanda commented Dec 20, 2016

@Ivorius Can you try assets from master branch? :) Is it ok?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.