Skip to content

Commit adfb7d6

Browse files
author
Alexandru Badiu
committed
Merge pull request farhadi#39 from davidchambers/master
fix incorrectly anchored regular expressions
2 parents c436dab + 8a602fe commit adfb7d6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

jquery.sortable.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ $.fn.sortable = function(options) {
1313
connectWith: false
1414
}, options);
1515
return this.each(function() {
16-
if (/^enable|disable|destroy$/.test(method)) {
16+
if (/^(enable|disable|destroy)$/.test(method)) {
1717
var items = $(this).children($(this).data('items')).attr('draggable', method == 'enable');
1818
if (method == 'destroy') {
1919
items.add(this).removeData('connectWith items')
@@ -22,7 +22,7 @@ $.fn.sortable = function(options) {
2222
return;
2323
}
2424
var isHandle, index, items = $(this).children(options.items);
25-
var placeholder = $('<' + (/^ul|ol$/i.test(this.tagName) ? 'li' : 'div') + ' class="sortable-placeholder">');
25+
var placeholder = $('<' + (/^(ul|ol)$/i.test(this.tagName) ? 'li' : 'div') + ' class="sortable-placeholder">');
2626
items.find(options.handle).mousedown(function() {
2727
isHandle = true;
2828
}).mouseup(function() {

0 commit comments

Comments
 (0)