Ver código fonte

HUE-47. FitText filter isn't garbage collecting right

* still wasn't detatching the FitText instance from the window resize event
Aaron Newton 15 anos atrás
pai
commit
2e2039d4c1

+ 2 - 0
desktop/core/static/js/Source/BehaviorFilters/Behavior.FitText.js

@@ -62,6 +62,8 @@ script: Behavior.FitText.js
 				var offset = element.get('data', 'fit-text-offset', true);
 				if (offset != null) options.offset = offset;
 				var fitText = new FitText(element, span, options);
+				//detach the window resize events that FitText attaches itself
+				fitText.detach();
 				fitText.fit();
 				element.store('FitText', fitText).set('title', text);
 				var fitTextFit = fitText.fit.bind(fitText);