Skip to content

Commit

Permalink
修复拖拽按钮外无法选中文字的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
karsonzhang committed Jun 18, 2024
1 parent 950f46a commit 276bba5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dragsort",
"version": "1.0.2",
"version": "1.0.4",
"authors": [
"Michael McDonald"
],
Expand Down
5 changes: 5 additions & 0 deletions jquery.dragsort.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@
if (e.which != 1 || $(e.target).is(opts.dragSelectorExclude) || $(e.target).closest(opts.dragSelectorExclude).length > 0 || !insideMoveableItem)
return;

// if not clicked on drag selector
if (!$(e.target).is(opts.dragSelector) && !$(e.target).closest(opts.dragSelector).length){
return;
}

//prevents selection, stops issue on Fx where dragging hyperlink doesn't work and on IE where it triggers mousemove even though mouse hasn't moved,
//does also stop being able to click text boxes hence dragging on text boxes by default is disabled in dragSelectorExclude
e.preventDefault();
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fastadmin-dragsort",
"version": "1.0.3",
"version": "1.0.4",
"description": "Project Description\r =====================",
"main": "jquery.dragsort.js",
"directories": {
Expand Down

0 comments on commit 276bba5

Please sign in to comment.