Skip to content
This repository

Selectable #133

Merged
1 commit merged into from about 3 years ago

1 participant

Nils Hörrmann
Nils Hörrmann
Collaborator

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

Showing 1 unique commit by 1 author.

Feb 16, 2011
Nils Hörrmann Fix Selectable 23e814b
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 13 additions and 13 deletions. Show diff stats Hide diff stats

  1. 26  symphony/assets/symphony.selectable.js
26  symphony/assets/symphony.selectable.js
@@ -87,31 +87,31 @@
87 87
 				}
88 88
 
89 89
 				// Toggle selection
90  
-				item.toggleClass('selected');
91  
-				item.find('input[type="checkbox"]').attr('checked', true);
92  
-
93  
-				// Fire event
94 90
 				if(item.is('.selected')) {
95  
-					item.trigger('select');
  91
+					item.removeClass('selected').trigger('deselect');
  92
+					item.find('input[type="checkbox"]').attr('checked', false);		
96 93
 				}
97 94
 				else {
98  
-					item.trigger('deselect');
  95
+					item.addClass('selected').trigger('select');
  96
+					item.find('input[type="checkbox"]').attr('checked', true);		
99 97
 				}
100 98
 			}
101 99
 
102 100
 		});
103 101
 
104 102
 		// Handle highlighting conflicts between orderable and selectable items
105  
-		objects.find(settings.items).bind('mousedown.selectable', function(event) {
106  
-			$(this).addClass('selecting');
107  
-		});
108  
-		objects.find(settings.items).bind('mouseup.selectable mousemove.selectable', function(event) {
109  
-			$(this).removeClass('selecting');
110  
-		});
  103
+		if(objects.is('.orderable')) {
  104
+			objects.find(settings.items).bind('mousedown.selectable', function(event) {
  105
+				$(this).addClass('selecting');
  106
+			});
  107
+			objects.find(settings.items).bind('mouseup.selectable mousemove.selectable', function(event) {
  108
+				$(this).removeClass('selecting');
  109
+			});
  110
+		}
111 111
 
112 112
 		// Remove all selections by doubleclicking the body
113 113
 		$('body').bind('dblclick.selectable', function() {
114  
-			objects.find(settings.items).removeClass('selected');
  114
+			objects.find(settings.items).removeClass('selected').trigger('deselect');
115 115
 		});
116 116
 
117 117
 		// Return objects
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.