From ab82783cf1261cae6abec5220d45762517d2183e Mon Sep 17 00:00:00 2001 From: Luke Murray Date: Tue, 13 Aug 2013 10:33:12 +1000 Subject: [PATCH] update the comments and unit test --- src/eventhandler.js | 2 +- test/basic.js | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/eventhandler.js b/src/eventhandler.js index f82a55b3..8e608806 100644 --- a/src/eventhandler.js +++ b/src/eventhandler.js @@ -92,7 +92,7 @@ $.EventHandler.prototype = { /** * 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 * @param {String} eventName - Name of event for which all handlers are to be removed. */ diff --git a/test/basic.js b/test/basic.js index f83d7c80..7e0492c0 100644 --- a/test/basic.js +++ b/test/basic.js @@ -211,13 +211,13 @@ // ---------- asyncTest('Destroy', function() { viewer.addHandler("open", function () { - start(); // Check that the DOM has been modified notEqual(0, $('#example').children().length); + var closeCalled = false; var closeHandler = function() { viewer.removeHandler('close', closeHandler); - ok(true, 'Close event was sent on Destroy'); + closeCalled = true; }; viewer.addHandler('close', closeHandler); @@ -229,6 +229,8 @@ equal(null, viewer.keyboardCommandArea); equal(null, viewer.container); equal(null, viewer.element); + equal(true, closeCalled); + start(); }); viewer.open('/test/data/testpattern.dzi'); });