js : eventdispatcher class