diff --git a/IPython/html/static/tree/js/notebooklist.js b/IPython/html/static/tree/js/notebooklist.js
index e98415f..de02381 100644
--- a/IPython/html/static/tree/js/notebooklist.js
+++ b/IPython/html/static/tree/js/notebooklist.js
@@ -597,12 +597,13 @@ define([
/**
* Remove the deleted notebook.
*/
+ var that = this;
$( ":data(path)" ).each(function() {
var element = $(this);
- if (element.data("path") == path) {
+ if (element.data("path") === path) {
element.remove();
events.trigger('notebook_deleted.NotebookList');
- this._selection_changed();
+ that._selection_changed();
}
});
};