r834 - branches/experimental/ui

r834 - branches/experimental/ui


Author: rdworth
Date: Thu Oct 23 18:04:32 2008
New Revision: 834
Modified:
branches/experimental/ui/ui.selectable.js
Log:
corrected plugin name in header, whitespace
Modified: branches/experimental/ui/ui.selectable.js
==============================================================================
--- branches/experimental/ui/ui.selectable.js    (original)
+++ branches/experimental/ui/ui.selectable.js    Thu Oct 23 18:04:32 2008
@@ -1,5 +1,5 @@
/*
- * jQuery UI Resizable @VERSION
+ * jQuery UI Selectable @VERSION
*
* Copyright (c) 2008 Paul Bakaus
* Dual licensed under the MIT (MIT-LICENSE.txt)
@@ -46,7 +46,7 @@
                    self.currentFocus.removeClass(self.options.focusedClass);
                })
                .bind('keydown.selectable', function(e) {
-
+                    
                    if(e.keyCode == $.keyCode.DOWN || e.keyCode == $.keyCode.RIGHT) {
                        self.selectNext(e);
                        e.preventDefault();
@@ -56,11 +56,11 @@
                        self.selectPrevious(e);
                        e.preventDefault();
                    }
-
+                    
                });
            
        },
-
+        
        _selection: [],
        
        _clearSelection: function() {
@@ -82,7 +82,7 @@
                this._addToSelection(item);
            }
        },
-
+        
        _addToSelection: function(item) {
            
            if(item.data('ui-selected'))
@@ -97,7 +97,7 @@
        },
        
        _removeFromSelection: function(item) {
-
+            
            for (var i=0; i < this._selection.length; i++) {
                if(this._selection[i][0] == item[0]) {
                    this._selection[i]
@@ -107,13 +107,13 @@
                    break;
                }
            };
-
+            
        },
-
+        
        _updateSelectionMouse: function(e) {
-
+            
            if(e.shiftKey && this.options.multiple) {
-
+                
                //Clear the previous selection to make room for a shift selection
                this._clearSelection();
                
@@ -136,15 +136,15 @@
                    this._addToSelection(this.currentFocus);
                    this.latestWithoutModifier = this.currentFocus;
                }
-
+                
            }
            
        },
        
        _updateSelection: function(e, dir) {
-
+            
            if(e.shiftKey && this.options.multiple) {
-
+                
                if(this.currentFocus.data('ui-selected')) {
                    this._removeFromSelection(this.previousFocus);
                } else {
@@ -157,7 +157,7 @@
                            i = i[dir2]();
                        }
                    }
-
+                    
                    this._addToSelection(this.currentFocus);
                    
                }
@@ -175,7 +175,7 @@
            }
            
        },
-
+        
        _select: function(e, item) {
            
            //Set the current selection to the previous/next item
@@ -184,17 +184,17 @@
            
            this.previousFocus.removeClass(this.options.focusedClass);
            this.currentFocus.addClass(this.options.focusedClass);
-
+            
            //Set and update the selection
            this._updateSelectionMouse(e);
            
            //Trigger select event
            this._trigger('select', e, this._uiHash(e));
-
+            
        },
-
+        
        _selectAdjacent: function(e, dir) {
-
+            
            //Bail if there's no previous/next item
            if(!this.currentFocus[dir]().length)
                return;
@@ -205,13 +205,13 @@
            
            this.previousFocus.removeClass(this.options.focusedClass);
            this.currentFocus.addClass(this.options.focusedClass);
-
+            
            //Set and update the selection
            this._updateSelection(e, dir);
            
            //Trigger select event
            this._trigger('select', e, this._uiHash(e));
-
+            
        },
        
        selectPrevious: function(e) {
@@ -241,4 +241,4 @@
        }
    });
    
-})(jQuery);
\ No newline at end of file
+})(jQuery);