Skip to content
This repository has been archived by the owner on May 4, 2022. It is now read-only.

Commit

Permalink
Remove KeepFocus directive (#933)
Browse files Browse the repository at this point in the history
  • Loading branch information
nogalpaulina authored Oct 4, 2021
1 parent 71ae118 commit 3a7c270
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 21 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Versions in this document should match those

+ Automate migrating layout from old layout backend to new layout backend.
+ Ensure there are no duplicate fnames in layout
+ Remove ineffectual KeepFocus directive

## 13.0.0 - 2021-04-23

Expand Down
19 changes: 0 additions & 19 deletions web/src/main/webapp/my-app/layout/directives.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,24 +55,5 @@ define(['angular', 'require'], function(angular, require) {
restrict: 'E',
templateUrl: require.toUrl('./partials/remove-button.html'),
};
})
.directive('keepFocus', function($timeout) {
return {
restrict: 'A',
scope: {
nodeId: '@',
index: '@',
selectedNodeId: '@',
},
link: function($scope, $element, attrs) {
$scope.$watch('index', function(currentValue, previousValue) {
if ($scope.nodeId === $scope.selectedNodeId) {
$timeout(function() {
$element[0].focus();
});
}
});
},
};
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
<li class="no-padding widget-container"
tabindex="0"
aria-label="{{ widget.title }}"
keep-focus
node-id="{{ widget.nodeId }}"
selected-node-id="{{ selectedNodeId }}"
index="{{ $index }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
<li class="no-padding widget-container"
tabindex="0"
aria-label="{{ widget.title }}"
keep-focus
node-id="{{ widget.nodeId }}"
selected-node-id="{{ selectedNodeId }}"
index="{{ $index }}"
Expand Down

0 comments on commit 3a7c270

Please sign in to comment.