update the comments and unit test

This commit is contained in:
Luke Murray 2013-08-13 10:33:12 +10:00
parent 0c662b8a8d
commit ab82783cf1
2 changed files with 5 additions and 3 deletions

View File

@ -92,7 +92,7 @@ $.EventHandler.prototype = {
/** /**
* Remove all event handlers for a given event type. If no type is given all * Remove all event handlers for a given event type. If no type is given all
* event handlers for every event type is removed. * event handlers for every event type are removed.
* @function * @function
* @param {String} eventName - Name of event for which all handlers are to be removed. * @param {String} eventName - Name of event for which all handlers are to be removed.
*/ */

View File

@ -211,13 +211,13 @@
// ---------- // ----------
asyncTest('Destroy', function() { asyncTest('Destroy', function() {
viewer.addHandler("open", function () { viewer.addHandler("open", function () {
start();
// Check that the DOM has been modified // Check that the DOM has been modified
notEqual(0, $('#example').children().length); notEqual(0, $('#example').children().length);
var closeCalled = false;
var closeHandler = function() { var closeHandler = function() {
viewer.removeHandler('close', closeHandler); viewer.removeHandler('close', closeHandler);
ok(true, 'Close event was sent on Destroy'); closeCalled = true;
}; };
viewer.addHandler('close', closeHandler); viewer.addHandler('close', closeHandler);
@ -229,6 +229,8 @@
equal(null, viewer.keyboardCommandArea); equal(null, viewer.keyboardCommandArea);
equal(null, viewer.container); equal(null, viewer.container);
equal(null, viewer.element); equal(null, viewer.element);
equal(true, closeCalled);
start();
}); });
viewer.open('/test/data/testpattern.dzi'); viewer.open('/test/data/testpattern.dzi');
}); });