mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-10-20 11:52:12 +02:00
GUI -- Table scrolling fixed header directive no longer depends on a timeout function.
- Added a general directive that emits when ng-repeat is completed. Change-Id: I23131adecded9f0393334d003812845ac6b4f031
This commit is contained in:
parent
1eab7d5f25
commit
b0e66be049
@ -70,5 +70,14 @@
|
||||
}
|
||||
};
|
||||
|
||||
}])
|
||||
|
||||
// create a general ng-repeat complete notifier directive
|
||||
.directive('ngRepeatDone', [function () {
|
||||
return function (scope, element, attrs) {
|
||||
if(scope.$last) {
|
||||
scope.$emit('LastElement');
|
||||
}
|
||||
}
|
||||
}]);
|
||||
}());
|
||||
|
@ -113,7 +113,6 @@
|
||||
};
|
||||
}])
|
||||
|
||||
// TODO: find another solution other than timeout for waiting for ng-repeat to end
|
||||
.directive('onosFixedHeader', ['$window', '$timeout',
|
||||
'MastService', 'FnService',
|
||||
function (_$window_, $timeout, mast, _fs_) {
|
||||
@ -121,7 +120,8 @@
|
||||
$window = _$window_;
|
||||
fs = _fs_;
|
||||
var w = angular.element($window),
|
||||
table = d3.select(element[0]);
|
||||
table = d3.select(element[0]),
|
||||
shouldResize = false;
|
||||
|
||||
scope.$watch(function () {
|
||||
return {
|
||||
@ -136,10 +136,16 @@
|
||||
scope.windowWidth = newVal.w;
|
||||
|
||||
scope.setTableHW = function () {
|
||||
$timeout(function () {
|
||||
scope.$on('LastElement', function (event) {
|
||||
fixTable(table, thead, tbody);
|
||||
}, 250);
|
||||
shouldResize = true;
|
||||
});
|
||||
};
|
||||
|
||||
if (shouldResize) {
|
||||
fixTable(table, thead, tbody);
|
||||
}
|
||||
|
||||
}, true);
|
||||
|
||||
w.bind('onos-fixed-header', function () {
|
||||
|
@ -18,7 +18,8 @@
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr ng-repeat="dev in ctrl.deviceData">
|
||||
<tr ng-repeat="dev in ctrl.deviceData"
|
||||
ng-repeat-done>
|
||||
<td><div icon icon-id="{{dev._iconid_available}}"></div></td>
|
||||
<td>{{dev.id}}</td>
|
||||
<td>{{dev.mfr}}</td>
|
||||
|
Loading…
x
Reference in New Issue
Block a user