Skip to content

Commit

Permalink
feat(taDOM): New services or dealing with html nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
SimeonC authored and SimeonC committed Feb 5, 2015
1 parent 7003b27 commit a08bdc5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/factories.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ angular.module('textAngular.factories', [])
else if(tag === '') return (_browserDetect.ie === undefined)? 'div' : (_browserDetect.ie <= 8)? 'P' : 'p';
else return (_browserDetect.ie <= 8)? tag.toUpperCase() : tag;
};
}]).factory('taApplyCustomRenderers', ['taCustomRenderers', function(taCustomRenderers){
}]).factory('taApplyCustomRenderers', ['taCustomRenderers', 'taDOM', function(taCustomRenderers, taDOM){
return function(val){
var element = angular.element('<div></div>');
element[0].innerHTML = val;
Expand All @@ -18,7 +18,7 @@ angular.module('textAngular.factories', [])
elements = element.find(renderer.selector);
/* istanbul ignore else: shouldn't fire, if it does we're ignoring everything */
else if(renderer.customAttribute && renderer.customAttribute !== '')
elements = getByAttribute(element, renderer.customAttribute);
elements = taDOM.getByAttribute(element, renderer.customAttribute);
// process elements if any found
angular.forEach(elements, function(_element){
_element = angular.element(_element);
Expand Down Expand Up @@ -55,7 +55,7 @@ angular.module('textAngular.factories', [])
return $html[0].innerHTML;
};
return taFixChrome;
}).factory('taSanitize', ['$sanitize', function taSanitizeFactory($sanitize){
}).factory('taSanitize', ['$sanitize', 'taDOM', function taSanitizeFactory($sanitize, taDOM){

var convert_infos = [
{
Expand Down Expand Up @@ -117,7 +117,7 @@ angular.module('textAngular.factories', [])
// setup unsafe element for modification
var unsafeElement = angular.element('<div>' + unsafe + '</div>');
// replace all align='...' tags with text-align attributes
angular.forEach(getByAttribute(unsafeElement, 'align'), function(element){
angular.forEach(taDOM.getByAttribute(unsafeElement, 'align'), function(element){
element.css('text-align', element.attr('align'));
element.removeAttr('align');
});
Expand Down

0 comments on commit a08bdc5

Please sign in to comment.