doh! had changed file name and class name of eventhandlerlist to just eventhandler and guess to forgot to add it back to git. plus other commits including version build id increment

This commit is contained in:
thatcher 2011-12-16 22:14:10 -05:00
parent acfd3d0280
commit 381763c19e
3 changed files with 56 additions and 2 deletions

View File

@ -6,7 +6,7 @@
PROJECT: openseadragon
BUILD_MAJOR: 0
BUILD_MINOR: 8
BUILD_ID: 12
BUILD_ID: 13
BUILD: ${PROJECT}.${BUILD_MAJOR}.${BUILD_MINOR}.${BUILD_ID}
VERSION: ${BUILD_MAJOR}.${BUILD_MINOR}.${BUILD_ID}

View File

@ -3,7 +3,7 @@
* (c) 2010 OpenSeadragon
* (c) 2010 CodePlex Foundation
*
* OpenSeadragon 0.8.12
* OpenSeadragon 0.8.13
* ----------------------------------------------------------------------------
*
* License: New BSD License (BSD)

54
src/eventhandler.js Normal file
View File

@ -0,0 +1,54 @@
(function($){
$.EventHandler = function() {
this.events = {};
};
$.EventHandler.prototype = {
addHandler: function(id, handler) {
var events = this.events[ id ];
if( !events ){
this.events[ id ] = events = [];
}
events[events.length] = handler;
},
removeHandler: function(id, handler) {
//Start Thatcher - unneccessary indirection. Also, because events were
// - not actually being removed, we need to add the code
// - to do the removal ourselves. TODO
var evt = this.events[ id ];
if (!evt) return;
//End Thatcher
},
getHandler: function(id) {
var evt = this.events[ id ];
if (!evt || !evt.length) return null;
evt = evt.length === 1 ?
[evt[0]] :
Array.apply( null, evt );
return function(source, args) {
for (var i = 0, l = evt.length; i < l; i++) {
evt[i](source, args);
}
};
},
raiseEvent: function(eventName, eventArgs) {
var handler = this.getHandler( eventName );
if (handler) {
if (!eventArgs) {
eventArgs = new Object();
}
handler(this, eventArgs);
}
}
};
}( OpenSeadragon ));