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'); });