Skip to content

Commit

Permalink
fix (taBind): don't deselect after 1000ms after applying styling text…
Browse files Browse the repository at this point in the history
…Angular#1381 - thanks to damien-otis for this fix
  • Loading branch information
JoelParke committed Nov 10, 2016
1 parent f16b880 commit f72d932
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/taBind.js
Original file line number Diff line number Diff line change
Expand Up @@ -957,13 +957,15 @@ angular.module('textAngular.taBind', ['textAngular.factories', 'textAngular.DOM'
if(_inputTimeout) $timeout.cancel(_inputTimeout);
/* istanbul ignore next: cant' test? */
_inputTimeout = $timeout(function() {
var _savedSelection = rangy.saveSelection();
var _val = _compileHtml();
if (_val !== ngModel.$viewValue) {
//console.log('_setViewValue');
//console.log('old:', ngModel.$viewValue);
//console.log('new:', _val);
_setViewValue(_val, true);
}
rangy.restoreSelection(_savedSelection);
}, 1000);
}
});
Expand Down

0 comments on commit f72d932

Please sign in to comment.