Bug Tracker

Changeset 5643

Show
Ignore:
Timestamp:
05/20/08 18:32:45 (3 months ago)
Author:
rdworth
Message:

ui experimental mouse - added mouse prefix to method names. Switched some apply calls to straight method calls.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/ui-experimental/mouse/ui.core.js

    r5639 r5643  
    162162 
    163163            this.element 
    164                 .bind('mousedown.mouse', function() { 
    165                     return self.down.apply(self, arguments); 
     164                .bind('mousedown.mouse', function(e) { 
     165                    return self.mouseDown(e); 
    166166                }); 
    167167 
     
    183183        }, 
    184184 
    185         down: function(e) { 
    186 console.log('down'); 
     185        mouseDown: function(e) { 
     186console.log('mouse.mouseDown'); 
    187187            var self = this; 
    188188            self._downEvent = e; 
     
    201201 
    202202                $(document) 
    203                     .bind('mousemove.mouse', function() { 
    204                         return self.move.apply(self, arguments); 
     203                    .bind('mousemove.mouse', function(e) { 
     204                        return self.mouseMove(e); 
    205205                    }) 
    206                     .bind('mouseup.mouse', function() { 
    207                         return self.up.apply(self, arguments); 
     206                    .bind('mouseup.mouse', function(e) { 
     207                        return self.mouseUp(e); 
    208208                    }); 
    209209 
     
    211211        }, 
    212212 
    213         move: function(e) { 
    214 console.log('move'); 
     213        mouseMove: function(e) { 
     214console.log('mouse.mouseMove'); 
    215215            var self = this; 
    216216            self._moveEvent = e; 
     
    224224                        Math.abs(this._downEvent.pageY - e.pageY) 
    225225                    ) >= this.options.mouseDistance 
    226                 ) 
    227                     this.start.apply(this, arguments); 
     226                ) { 
     227                    this.started = true; 
     228                    this.mouseStart(e); 
     229                } 
    228230            } else { 
    229231                // IE mouseup check 
    230232                if ($.browser.msie && !e.button) { 
    231                     return this.up(e); 
    232                 } 
    233                 this.drag.apply(this, arguments); 
    234  
    235             } 
    236         }, 
    237         start: function(e) { 
    238 console.log('start'); 
    239             this.started = true; 
    240         }, 
    241         drag: function(e) { 
    242 console.log('drag'); 
    243         }, 
    244  
    245         up: function(e) { 
    246 console.log('up'); 
     233                    return this.mouseUp(e); 
     234                } 
     235                this.mouseDrag(e); 
     236 
     237            } 
     238        }, 
     239        mouseStart: function(e) { 
     240console.log('mouse.mouseStart: override me'); 
     241        }, 
     242        mouseDrag: function(e) { 
     243console.log('mouse.mouseDrag: override me'); 
     244        }, 
     245 
     246        mouseUp: function(e) { 
     247console.log('mouse.mouseUp: override me'); 
    247248            $(document).unbind('.mouse'); 
    248             this.stop.apply(this, arguments); 
    249         }, 
    250         stop: function(e) { 
    251 console.log('stop'); 
    252             this.started = false; 
     249            if (this.started) { 
     250                this.started = false; 
     251                this.mouseStop(e); 
     252            } 
     253        }, 
     254        mouseStop: function(e) { 
     255console.log('mouse.mouseStop'); 
    253256        } 
    254257    }