Skip to content

Commit

Permalink
Fixed memory leak in window.blur
Browse files Browse the repository at this point in the history
  • Loading branch information
EJIqpEP committed Sep 11, 2015
1 parent 5c028f5 commit bd3e84f
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 30 deletions.
45 changes: 23 additions & 22 deletions dist/textAngular.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
/*
@license textAngular
Author : Austin Anderson
License : 2013 MIT
Version 1.4.3
See README.md or https://github.com/fraywing/textAngular/wiki for requirements and use.
*/

/*
Commonjs package manager support (eg componentjs).
*/

/* istanbul ignore next: */
'undefined'!=typeof module&&'undefined'!=typeof exports&&module.exports===exports&&(module.exports='textAngular');

(function(){ // encapsulate all variables so they don't become global vars
/*
@license textAngular
Author : Austin Anderson
License : 2013 MIT
Version 1.4.3
See README.md or https://github.com/fraywing/textAngular/wiki for requirements and use.
*/

/*
Commonjs package manager support (eg componentjs).
*/

/* istanbul ignore next: */
'undefined'!=typeof module&&'undefined'!=typeof exports&&module.exports===exports&&(module.exports='textAngular');

(function(){ // encapsulate all variables so they don't become global vars
"use strict";
// IE version detection - http://stackoverflow.com/questions/4169160/javascript-ie-detection-why-not-use-simple-conditional-comments
// We need this as IE sometimes plays funny tricks with the contenteditable.
Expand Down Expand Up @@ -189,7 +189,7 @@ if(_browserDetect.ie > 8 || _browserDetect.ie === undefined){
}
};
}


angular.module('textAngular.factories', [])
.factory('taBrowserTag', [function(){
return function(tag){
Expand Down Expand Up @@ -439,7 +439,7 @@ angular.module('textAngular.factories', [])
deferred.resolve();
}
};
}]);
}]);
angular.module('textAngular.DOM', ['textAngular.factories'])
.factory('taExecCommand', ['taSelection', 'taBrowserTag', '$document', function(taSelection, taBrowserTag, $document){
var listToDefault = function(listElement, defaultWrap){
Expand Down Expand Up @@ -928,7 +928,7 @@ function($window, $document, taDOM){
}
};
return taDOM;
});
});
angular.module('textAngular.validators', [])
.directive('taMaxText', function(){
return {
Expand Down Expand Up @@ -980,7 +980,7 @@ angular.module('textAngular.validators', [])
};
}
};
});
});
angular.module('textAngular.taBind', ['textAngular.factories', 'textAngular.DOM'])
.service('_taBlankTest', [function(){
var INLINETAGS_NONBLANK = /<(a|abbr|acronym|bdi|bdo|big|cite|code|del|dfn|img|ins|kbd|label|map|mark|q|ruby|rp|rt|s|samp|time|tt|var)[^>]*(>|$)/i;
Expand Down Expand Up @@ -1929,7 +1929,7 @@ angular.module('textAngular.taBind', ['textAngular.factories', 'textAngular.DOM'
}
};
}]);


// this global var is used to prevent multiple fires of the drop event. Needs to be global to the textAngular file.
var dropFired = false;
var textAngular = angular.module("textAngular", ['ngSanitize', 'textAngularSetup', 'textAngular.factories', 'textAngular.DOM', 'textAngular.validators', 'textAngular.taBind']); //This makes ngSanitize required
Expand Down Expand Up @@ -2479,6 +2479,7 @@ textAngular.directive("textAngular", [

scope.$on('$destroy', function(){
textAngularManager.unregisterEditor(scope._name);
angular.element(window).off('blur');
});

// catch element select event and pass to toolbar tools
Expand Down
Loading

0 comments on commit bd3e84f

Please sign in to comment.