Skip to content

Commit a08bdc5

Browse files
SimeonCSimeonC
SimeonC
authored and
SimeonC
committedFeb 5, 2015
feat(taDOM): New services or dealing with html nodes
1 parent 7003b27 commit a08bdc5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎lib/factories.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ angular.module('textAngular.factories', [])
66
else if(tag === '') return (_browserDetect.ie === undefined)? 'div' : (_browserDetect.ie <= 8)? 'P' : 'p';
77
else return (_browserDetect.ie <= 8)? tag.toUpperCase() : tag;
88
};
9-
}]).factory('taApplyCustomRenderers', ['taCustomRenderers', function(taCustomRenderers){
9+
}]).factory('taApplyCustomRenderers', ['taCustomRenderers', 'taDOM', function(taCustomRenderers, taDOM){
1010
return function(val){
1111
var element = angular.element('<div></div>');
1212
element[0].innerHTML = val;
@@ -18,7 +18,7 @@ angular.module('textAngular.factories', [])
1818
elements = element.find(renderer.selector);
1919
/* istanbul ignore else: shouldn't fire, if it does we're ignoring everything */
2020
else if(renderer.customAttribute && renderer.customAttribute !== '')
21-
elements = getByAttribute(element, renderer.customAttribute);
21+
elements = taDOM.getByAttribute(element, renderer.customAttribute);
2222
// process elements if any found
2323
angular.forEach(elements, function(_element){
2424
_element = angular.element(_element);
@@ -55,7 +55,7 @@ angular.module('textAngular.factories', [])
5555
return $html[0].innerHTML;
5656
};
5757
return taFixChrome;
58-
}).factory('taSanitize', ['$sanitize', function taSanitizeFactory($sanitize){
58+
}).factory('taSanitize', ['$sanitize', 'taDOM', function taSanitizeFactory($sanitize, taDOM){
5959

6060
var convert_infos = [
6161
{
@@ -117,7 +117,7 @@ angular.module('textAngular.factories', [])
117117
// setup unsafe element for modification
118118
var unsafeElement = angular.element('<div>' + unsafe + '</div>');
119119
// replace all align='...' tags with text-align attributes
120-
angular.forEach(getByAttribute(unsafeElement, 'align'), function(element){
120+
angular.forEach(taDOM.getByAttribute(unsafeElement, 'align'), function(element){
121121
element.css('text-align', element.attr('align'));
122122
element.removeAttr('align');
123123
});

0 commit comments

Comments
 (0)