Skip to content

Commit

Permalink
fix(main): fix for #655 activeState seemingly not firing after the fi…
Browse files Browse the repository at this point in the history
…rst click after a highlight #655
  • Loading branch information
JoelParke committed Sep 18, 2016
1 parent 5640237 commit 6ecc1c1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main.js
Expand Up @@ -683,9 +683,11 @@ textAngular.directive("textAngular", [
_mouseup = function(){
// ensure only one execution of updateSelectedStyles()
scope._bUpdateSelectedStyles = false;
scope.$apply(function(){
scope.updateSelectedStyles();
});
// for some reason, unless we do a $timeout here, after a _mouseup when the line is
// highlighted, and instead use a scope.$apply(function(){ scope.updateSelectedStyles(); });
// doesn't work properly, so we replaced this with:
/* istanbul ignore next: not tested */
$timeout(function() { scope.updateSelectedStyles(); }, 0);
};
scope.displayElements.html.on('mouseup', _mouseup);
scope.displayElements.text.on('mouseup', _mouseup);
Expand Down

0 comments on commit 6ecc1c1

Please sign in to comment.