Skip to content

Commit 17b4497

Browse files
authoredJul 29, 2016
Merge pull request #1257 from JoelParke/master
Fix(taBind): Corrected issue around model becomes empty Issue #1230
2 parents 3870b5c + 6e0fb14 commit 17b4497

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed
 

‎src/main.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,10 @@ textAngular.directive("textAngular", [
258258
'ng-model-options': element.attr('ng-model-options')
259259
});
260260
scope.displayElements.scrollWindow.attr({'ng-hide': 'showHtml'});
261-
if(attrs.taDefaultWrap) scope.displayElements.text.attr('ta-default-wrap', attrs.taDefaultWrap);
261+
if(attrs.taDefaultWrap) {
262+
// taDefaultWrap is only applied to the text and the not the html view
263+
scope.displayElements.text.attr('ta-default-wrap', attrs.taDefaultWrap);
264+
}
262265

263266
if(attrs.taUnsafeSanitizer){
264267
scope.displayElements.text.attr('ta-unsafe-sanitizer', attrs.taUnsafeSanitizer);

‎src/taBind.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
angular.module('textAngular.taBind', ['textAngular.factories', 'textAngular.DOM'])
22
.service('_taBlankTest', [function(){
3-
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;
3+
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|table)[^>]*(>|$)/i;
44
return function(_defaultTest){
55
return function(_blankVal){
66
if(!_blankVal) return true;
@@ -189,7 +189,7 @@ angular.module('textAngular.taBind', ['textAngular.factories', 'textAngular.DOM'
189189
for(i = 0; i < _children.length; i++){
190190
var node = _children[i];
191191
var nodeName = node.nodeName.toLowerCase();
192-
//console.log(nodeName);
192+
//console.log('node#:', i, 'name:', nodeName);
193193
if(nodeName === '#comment') {
194194
value += '<!--' + node.nodeValue + '-->';
195195
} else if(nodeName === '#text') {
@@ -213,6 +213,7 @@ angular.module('textAngular.taBind', ['textAngular.factories', 'textAngular.DOM'
213213
} else {
214214
value += node.outerHTML;
215215
}
216+
//console.log(value);
216217
}
217218
}
218219
}

0 commit comments

Comments
 (0)