From a28b6fe21e945037b2fe99b8789ec440d22d9cc7 Mon Sep 17 00:00:00 2001 From: David Huynh Date: Mon, 18 Oct 2010 17:44:42 +0000 Subject: [PATCH] Made sure suggest widgets automatically clean up their stuff when they get removed. git-svn-id: http://google-refine.googlecode.com/svn/trunk@1604 7d457c2a-affb-35e4-300a-418c747d4874 --- .../modules/core/scripts/util/custom-suggest.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/main/webapp/modules/core/scripts/util/custom-suggest.js b/main/webapp/modules/core/scripts/util/custom-suggest.js index 314333211..8b013bdd0 100644 --- a/main/webapp/modules/core/scripts/util/custom-suggest.js +++ b/main/webapp/modules/core/scripts/util/custom-suggest.js @@ -1,4 +1,17 @@ (function() { + /* + * Make suggest widgets clean up when removed. + */ + var oldInit = $.suggest.suggest.prototype._init; + $.suggest.suggest.prototype._init = function() { + oldInit.call(this); + + var self = this; + this.input.bind("remove", function() { + self._destroy(); + }); + }; + /* * Property suggest */