Skip to content

Commit

Permalink
Fixed #3077 (Selectable cannot be selected by click)
Browse files Browse the repository at this point in the history
  • Loading branch information
rdworth committed Jan 16, 2009
1 parent 3887ee7 commit 2809d50
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions ui/ui.selectable.js
Expand Up @@ -33,8 +33,8 @@ $.widget("ui.selectable", $.extend({}, $.ui.mouse, {
$element: $this,
left: pos.left,
top: pos.top,
right: pos.left + $this.width(),
bottom: pos.top + $this.height(),
right: pos.left + $this.outerWidth(),
bottom: pos.top + $this.outerHeight(),
startselected: false,
selected: $this.hasClass('ui-selected'),
selecting: $this.hasClass('ui-selecting'),
Expand Down Expand Up @@ -105,11 +105,21 @@ $.widget("ui.selectable", $.extend({}, $.ui.mouse, {
}
});

var isSelectee = false;
$(event.target).parents().andSelf().each(function() {
if($.data(this, "selectable-item")) isSelectee = true;
var selectee = $.data(this, "selectable-item");
if (selectee) {
selectee.$element.removeClass("ui-unselecting").addClass('ui-selecting');
selectee.unselecting = false;
selectee.selecting = true;
selectee.selected = true;
// selectable SELECTING callback
self._trigger("selecting", event, {
selecting: selectee.element
});
return false;
}
});
return this.options.keyboard ? !isSelectee : true;

},

_mouseDrag: function(event) {
Expand Down Expand Up @@ -238,7 +248,7 @@ $.extend($.ui.selectable, {
autoRefresh: true,
cancel: ":input,option",
delay: 0,
distance: 1,
distance: 0,
filter: '*',
tolerance: 'touch'
}
Expand Down

0 comments on commit 2809d50

Please sign in to comment.