Changeset 6615
- Timestamp:
- 04/28/07 22:52:18 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
spinoffs/prototype/branches/event/src/event.js
r6613 r6615 81 81 var local = this.element._observers[this.type]; 82 82 if (!local) local = this.element._observers[this.type] = {}; 83 if (!this.observer.$$guid) this.observer.$$guid = this.constructor.guid++;83 if (!this.observer.$$guid) this.observer.$$guid = Observer.guid++; 84 84 local[this.observer.$$guid] = this; 85 85 }, … … 190 190 }; 191 191 } 192 else var isButton = function(event, code) { return event.button === code }; 192 else var isButton = function(event, code) { 193 return event.which ? event.which === code+1 : event.button === code; 194 }; 193 195 194 196 return { spinoffs/prototype/branches/event/test/functional/event.html
r6614 r6615 102 102 var basic_callback = function(e){ 103 103 $('basic').passed() 104 $('basic_remove').show() 104 if ($('basic_remove')) $('basic_remove').show() 105 else $('basic').failed() 105 106 log(e) 106 107 } … … 109 110 el = $('basic') 110 111 el.passed('This test should now be inactive (try clicking)') 111 el.stopObserving('click' , basic_callback)112 el.stopObserving('click') 112 113 $('basic_remove').remove() 113 114 log(e) … … 266 267 Event.observe($A($('list2').childNodes), 'click', function(e){ 267 268 var list = this.parentNode 268 e.stopPropagation()269 e.stopPropagation() 269 270 $('each2').failed() 270 271 log(e)