Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Core: Removed .disableSelection() #485

Closed
wants to merge 1 commit into from

4 participants

@scottgonzalez

ZOMG!

@scottgonzalez

We should remove this from all of the demos and the plugins now. Deprecate the methods in 1.9 and remove them in 2.0.

@scottgonzalez

Should fix #7737.

@scottgonzalez

Close #7735 as wontfix.

@gnarf
Owner

Agree - if we don't actually need it for anything... Why do we have it?

@scottgonzalez

Apparently someone thought we needed it...

@scottgonzalez

Quick testing in IE 6 shows that this causes selection regressions in the delayed draggable demos. Apparently we have to prevent the default action of mousemove all the time. We're currently only preventing it if we've already met the distance/delay tolerance. I'm not sure if there are any negative side effects to always preventing the default action.

@scottgonzalez scottgonzalez commented on the diff
ui/jquery.ui.dialog.js
@@ -142,7 +142,7 @@ $.widget("ui.dialog", {
.html( title )
.prependTo( uiDialogTitlebar );
- uiDialogTitlebar.find( "*" ).add( uiDialogTitlebar ).disableSelection();
+ uiDialogTitlebar.find( "*" ).add( uiDialogTitlebar );
@scottgonzalez Owner

This whole line should've been deleted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@mikesherov
Collaborator

Is this landable now that the new site is launched?

@scottgonzalez

I think there needs to be another round of testing in IE. I don't remember if this was just an IE6 problem, but I'm assuming it wasn't.

@scottgonzalez

Testing PR notification.

@scottgonzalez scottgonzalez reopened this
@ClintYarborough

disableSelection was causing issues in our site while using .sortable in IE9. When we call disableSelection after .sortable, in IE9 it makes the textboxes inside of the sortable divs unselectable, in Chrome and Firefox the textboxes are selectable. So far in our testing after removing the disableSelection line after .sortable I haven't seen any adverse affects.

@scottgonzalez scottgonzalez deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 1, 2011
  1. @scottgonzalez
This page is out of date. Refresh to see the latest.
View
1  demos/draggable/delay-start.html
@@ -17,7 +17,6 @@
$(function() {
$( "#draggable" ).draggable({ distance: 20 });
$( "#draggable2" ).draggable({ delay: 1000 });
- $( ".ui-draggable" ).disableSelection();
});
</script>
</head>
View
1  demos/draggable/handle.html
@@ -18,7 +18,6 @@
$(function() {
$( "#draggable" ).draggable({ handle: "p" });
$( "#draggable2" ).draggable({ cancel: "p.ui-widget-header" });
- $( "div, p" ).disableSelection();
});
</script>
</head>
View
1  demos/draggable/sortable.html
@@ -25,7 +25,6 @@
helper: "clone",
revert: "invalid"
});
- $( "ul, li" ).disableSelection();
});
</script>
</head>
View
2  demos/sortable/connect-lists-through-tabs.html
@@ -17,7 +17,7 @@
</style>
<script>
$(function() {
- $( "#sortable1, #sortable2" ).sortable().disableSelection();
+ $( "#sortable1, #sortable2" ).sortable();
var $tabs = $( "#tabs" ).tabs();
View
2  demos/sortable/connect-lists.html
@@ -18,7 +18,7 @@
$(function() {
$( "#sortable1, #sortable2" ).sortable({
connectWith: ".connectedSortable"
- }).disableSelection();
+ });
});
</script>
</head>
View
1  demos/sortable/default.html
@@ -18,7 +18,6 @@
<script>
$(function() {
$( "#sortable" ).sortable();
- $( "#sortable" ).disableSelection();
});
</script>
</head>
View
2  demos/sortable/delay-start.html
@@ -23,8 +23,6 @@
$( "#sortable2" ).sortable({
distance: 15
});
-
- $( "li" ).disableSelection();
});
</script>
</head>
View
1  demos/sortable/display-grid.html
@@ -17,7 +17,6 @@
<script>
$(function() {
$( "#sortable" ).sortable();
- $( "#sortable" ).disableSelection();
});
</script>
</head>
View
2  demos/sortable/empty-lists.html
@@ -24,8 +24,6 @@
connectWith: "ul",
dropOnEmpty: false
});
-
- $( "#sortable1, #sortable2, #sortable3" ).disableSelection();
});
</script>
</head>
View
2  demos/sortable/items.html
@@ -23,8 +23,6 @@
$( "#sortable2" ).sortable({
cancel: ".ui-state-disabled"
});
-
- $( "#sortable1 li, #sortable2 li" ).disableSelection();
});
</script>
</head>
View
1  demos/sortable/placeholder.html
@@ -21,7 +21,6 @@
$( "#sortable" ).sortable({
placeholder: "ui-state-highlight"
});
- $( "#sortable" ).disableSelection();
});
</script>
</head>
View
3  demos/sortable/portlets.html
@@ -22,6 +22,7 @@
<script>
$(function() {
$( ".column" ).sortable({
+ handle: ".portlet-header",
connectWith: ".column"
});
@@ -36,8 +37,6 @@
$( this ).toggleClass( "ui-icon-minusthick" ).toggleClass( "ui-icon-plusthick" );
$( this ).parents( ".portlet:first" ).find( ".portlet-content" ).toggle();
});
-
- $( ".column" ).disableSelection();
});
</script>
</head>
View
4 demos/widget/default.html
@@ -44,9 +44,7 @@
_create: function() {
this.element
// add a class for theming
- .addClass( "custom-colorize" )
- // prevent double click to select text
- .disableSelection();
+ .addClass( "custom-colorize" );
this.changer = $( "<button>", {
text: "change",
View
11 ui/jquery.ui.core.js
@@ -115,17 +115,6 @@ $.fn.extend({
}
return 0;
- },
-
- disableSelection: function() {
- return this.bind( ( $.support.selectstart ? "selectstart" : "mousedown" ) +
- ".ui-disableSelection", function( event ) {
- event.preventDefault();
- });
- },
-
- enableSelection: function() {
- return this.unbind( ".ui-disableSelection" );
}
});
View
2  ui/jquery.ui.dialog.js
@@ -142,7 +142,7 @@ $.widget("ui.dialog", {
.html( title )
.prependTo( uiDialogTitlebar );
- uiDialogTitlebar.find( "*" ).add( uiDialogTitlebar ).disableSelection();
+ uiDialogTitlebar.find( "*" ).add( uiDialogTitlebar );
@scottgonzalez Owner

This whole line should've been deleted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
this._hoverable( uiDialogTitlebarClose );
this._focusable( uiDialogTitlebarClose );
View
7 ui/jquery.ui.resizable.js
@@ -158,8 +158,7 @@ $.widget("ui.resizable", $.ui.mouse, {
//TODO: make renderAxis a prototype function
this._renderAxis(this.element);
- this._handles = $('.ui-resizable-handle', this.element)
- .disableSelection();
+ this._handles = $('.ui-resizable-handle', this.element);
//Matching axis name
this._handles.mouseover(function() {
@@ -489,9 +488,7 @@ $.widget("ui.resizable", $.ui.mouse, {
zIndex: ++o.zIndex //TODO: Don't modify option
});
- this.helper
- .appendTo("body")
- .disableSelection();
+ this.helper.appendTo("body");
} else {
this.helper = this.element;
Something went wrong with that request. Please try again.