Skip to content

Commit

Permalink
Fix(DOM): merged fix from Hike-zzz: fixing issue #616 #1174
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelParke committed Jul 10, 2016
1 parent c2185a8 commit 328cd69
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/textAngular-rangy.min.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions dist/textAngular.js
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,9 @@ angular.module('textAngular.DOM', ['textAngular.factories'])
}
}
}
_nodes = _nodes.filter(function(value, index, self) {
return self.indexOf(value) === index;
});
if(angular.element(_nodes[0]).hasClass('ta-bind')){
$target = angular.element(options);
$target[0].innerHTML = _nodes[0].innerHTML;
Expand Down
6 changes: 3 additions & 3 deletions dist/textAngular.min.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions dist/textAngular.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -1426,6 +1426,9 @@ angular.module('textAngular.DOM', ['textAngular.factories'])
}
}
}
_nodes = _nodes.filter(function(value, index, self) {
return self.indexOf(value) === index;
});
if(angular.element(_nodes[0]).hasClass('ta-bind')){
$target = angular.element(options);
$target[0].innerHTML = _nodes[0].innerHTML;
Expand Down
3 changes: 3 additions & 0 deletions src/DOM.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ angular.module('textAngular.DOM', ['textAngular.factories'])
}
}
}
_nodes = _nodes.filter(function(value, index, self) {
return self.indexOf(value) === index;
});
if(angular.element(_nodes[0]).hasClass('ta-bind')){
$target = angular.element(options);
$target[0].innerHTML = _nodes[0].innerHTML;
Expand Down
8 changes: 8 additions & 0 deletions test/taExecCommand/taExecCommand.formatBlock.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ describe('taExecCommand', function(){
expect($element.html()).toBe('<blockquote><p>Some <b>test</b> content</p><p><br></p><p>Some <b>test</b> content</p></blockquote>');
$element.remove();
}));
it('selection with multiple nested inline nodes', inject(function($document, taExecCommand, taSelection){
$element = angular.element('<div class="ta-bind"><p><i>Try</i><b>me!</b></p></div>');
$document.find('body').append($element);
taSelection.element = $element.find('p')[0];
taExecCommand()('formatBlock', false, '<BLOCKQUOTE>');
expect($element.html()).toBe('<blockquote><p><i>Try</i><b>me!</b></p></blockquote>');
$element.remove();
}));
});
});
describe('unwraps elements', function(){
Expand Down

0 comments on commit 328cd69

Please sign in to comment.