GUACAMOLE-302: Merge narrowing of guacFocus behavior to simply setting/removing focus.

Additionally reporting whether the affected element receives or loses focus causes trouble if the source of the original value is non-assignable. It also seems like it could cause unexpected side effects if usages of guacFocus expect to separate their intent (assigning a value via the expression watched by guacFocus) from the result of attempting to set/remove focus. If tracking of focus is needed, that would best be served by another directive dedicated solely to tracking.
This commit is contained in:
Mike Jumper
2019-06-25 13:04:42 -07:00
committed by GitHub

View File

@@ -52,20 +52,6 @@ angular.module('element').directive('guacFocus', ['$parse', function guacFocus($
});
});
// Set focus flag when focus is received
element.addEventListener('focus', function focusReceived() {
$scope.$evalAsync(function setGuacFocusAsync() {
guacFocus.assign($scope, true);
});
});
// Unset focus flag when focus is lost
element.addEventListener('blur', function focusLost() {
$scope.$evalAsync(function unsetGuacFocusAsync() {
guacFocus.assign($scope, false);
});
});
} // end guacFocus link function
};