Skip to content
This repository has been archived by the owner on Dec 15, 2020. It is now read-only.

Commit

Permalink
fixed issue #1
Browse files Browse the repository at this point in the history
  • Loading branch information
kbjr committed Oct 31, 2011
1 parent bd3d8c1 commit 7d3236e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

JS_MIN = uglifyjs
JS_MIN_FLAGS = --unsafe

build:
${JS_MIN} ${JS_MIN_FLAGS} drag-drop.js > drag-drop.min.js

clean:
rm -f drag-drop.min.js

11 changes: 8 additions & 3 deletions drag-drop.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* to elements for advanced UI development.
*
* @author James Brumond
* @version 0.1.1-dev
* @version 0.1.2-beta
* @copyright Copyright 2011 James Brumond
* @license Dual licensed under MIT and GPL
*/
Expand Down Expand Up @@ -214,10 +214,15 @@
return false;
},

// Regular expressions for matching classnames
cnRegexes = { },

// Remove a class from an element
removeClass = function(elem, cn) {
var regex = new RegExp('(^|\\s)+' + cn + '(\\s|$)+');
elem.className.replace(regex, ' ');
if (! cnRegexes[cn]) {
cnRegexes[cn] = new RegExp('(^|\\s)+' + cn + '(\\s|$)+');
}
elem.className = elem.className.replace(cnRegexes[cn], ' ');
},

// Add a class to an element
Expand Down
5 changes: 2 additions & 3 deletions drag-drop.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion readme.textile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ h1. DragDrop
h3. A JavaScript micro-framework for adding drag-and-drop functionality to elements for advanced UI development

Author: James Brumond
Version: 0.1.1-dev
Version: 0.1.2-beta

Copyright 2011 James Brumond
Dual licensed under MIT and GPL
Expand Down

0 comments on commit 7d3236e

Please sign in to comment.