From 24477c0164ff35c454ae4394fc8c7e7748dd8168 Mon Sep 17 00:00:00 2001 From: Seph Soliman Date: Tue, 12 Mar 2013 12:08:28 +0100 Subject: [PATCH] bump version. added minified copy of version 1.1. --- jquery.dragcheck.js | 2 +- jquery.dragcheck.min.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/jquery.dragcheck.js b/jquery.dragcheck.js index f148b19..20c2691 100644 --- a/jquery.dragcheck.js +++ b/jquery.dragcheck.js @@ -2,7 +2,7 @@ * jQuery.DragCheck - Click-and-drag over checkboxes to change their state. * Copyright (c) 2013 Seph Soliman - scarlac(at)gmail(dot)com | http://seph.dk * @author Seph Soliman -* @version 1.0 +* @version 1.1 * * https://github.com/scarlac/jquery-drag-check */ diff --git a/jquery.dragcheck.min.js b/jquery.dragcheck.min.js index 0c35ad7..7c03102 100644 --- a/jquery.dragcheck.min.js +++ b/jquery.dragcheck.min.js @@ -2,8 +2,8 @@ * jQuery.DragCheck - Click-and-drag over checkboxes to change their state. * Copyright (c) 2013 Seph Soliman - scarlac(at)gmail(dot)com | http://seph.dk * @author Seph Soliman -* @version 1.0 +* @version 1.1 * * https://github.com/scarlac/jquery-drag-check */ -(function(e){e.fn.dragCheck=function(){window.dragCheck_state=null;window.dragCheck_origin=null;this.mousedown(function(){window.dragCheck_state=!this.checked;window.dragCheck_origin=this}).mouseup(function(){window.dragCheck_state=null;window.dragCheck_origin=null}).mouseenter(function(t){if(window.dragCheck_state!==null){e(this).add(window.dragCheck_origin).prop("checked",window.dragCheck_state).trigger("change",t)}});e(document.body).mouseup(function(){window.dragCheck_state=null;window.dragCheck_origin=null})}})(jQuery) \ No newline at end of file +(function($){$.fn.dragCheck=function(options){var settings=$.extend({'deferChangeTrigger':false,'onDragEnd':undefined,'onChange':undefined},options);window.dragCheck_state=window.dragCheck_state||null;window.dragCheck_origin=window.dragCheck_origin||null;window.dragCheck_items=window.dragCheck_items||[];var dragEnd=function(){if(window.dragCheck_state!==null){window.dragCheck_state=null;window.dragCheck_origin=null;if(settings.onDragEnd){settings.onDragEnd(window.dragCheck_items)}else{if(window.dragCheck_items.length>0){for(var i in window.dragCheck_items){if(settings.onChange)settings.onChange.call(window.dragCheck_items[i]);else window.dragCheck_items[i].trigger('change')}}}window.dragCheck_items=[]}}this.mousedown(function(){window.dragCheck_state=!this.checked;window.dragCheck_origin=this}).mouseup(dragEnd).mouseenter(function(e){if(window.dragCheck_state!==null){var item=$(this).add(window.dragCheck_origin).prop('checked',window.dragCheck_state);if(settings.deferChangeTrigger){window.dragCheck_items.push(item)}else{if(settings.onChange)settings.onChange.call(item,e);else item.trigger('change',e)}}});$(document.body).mouseup(dragEnd)}})(jQuery); \ No newline at end of file