Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Selectable #133

Merged
1 commit merged into from

1 participant

@nilshoerrmann

See issue #567.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 16, 2011
  1. @nilshoerrmann

    Fix Selectable

    nilshoerrmann authored
This page is out of date. Refresh to see the latest.
Showing with 13 additions and 13 deletions.
  1. +13 −13 symphony/assets/symphony.selectable.js
View
26 symphony/assets/symphony.selectable.js
@@ -87,31 +87,31 @@
}
// Toggle selection
- item.toggleClass('selected');
- item.find('input[type="checkbox"]').attr('checked', true);
-
- // Fire event
if(item.is('.selected')) {
- item.trigger('select');
+ item.removeClass('selected').trigger('deselect');
+ item.find('input[type="checkbox"]').attr('checked', false);
}
else {
- item.trigger('deselect');
+ item.addClass('selected').trigger('select');
+ item.find('input[type="checkbox"]').attr('checked', true);
}
}
});
// Handle highlighting conflicts between orderable and selectable items
- objects.find(settings.items).bind('mousedown.selectable', function(event) {
- $(this).addClass('selecting');
- });
- objects.find(settings.items).bind('mouseup.selectable mousemove.selectable', function(event) {
- $(this).removeClass('selecting');
- });
+ if(objects.is('.orderable')) {
+ objects.find(settings.items).bind('mousedown.selectable', function(event) {
+ $(this).addClass('selecting');
+ });
+ objects.find(settings.items).bind('mouseup.selectable mousemove.selectable', function(event) {
+ $(this).removeClass('selecting');
+ });
+ }
// Remove all selections by doubleclicking the body
$('body').bind('dblclick.selectable', function() {
- objects.find(settings.items).removeClass('selected');
+ objects.find(settings.items).removeClass('selected').trigger('deselect');
});
// Return objects
Something went wrong with that request. Please try again.