Skip to content

Commit cefb408

Browse files
authored
Merge pull request nasa#1042 from nasa/open1040
[Tables] Enabled auto-scroll by default fixes nasa#1040
2 parents d741e0f + ee7c450 commit cefb408

File tree

3 files changed

+1
-31
lines changed

3 files changed

+1
-31
lines changed

platform/features/table/res/templates/rt-table.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
enableFilter="true"
66
enableSort="true"
77
class="tabular-holder t-exportable"
8-
auto-scroll="autoScroll">
8+
auto-scroll="true">
99
</mct-table>
1010
</div>

platform/features/table/src/controllers/RealtimeTableController.js

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -38,30 +38,7 @@ define(
3838
function RealtimeTableController($scope, telemetryHandler, telemetryFormatter) {
3939
TableController.call(this, $scope, telemetryHandler, telemetryFormatter);
4040

41-
$scope.autoScroll = false;
4241
this.maxRows = 100000;
43-
44-
/*
45-
* Determine if auto-scroll should be enabled. Is enabled
46-
* automatically when telemetry type is string
47-
*/
48-
function hasStringTelemetry(domainObject) {
49-
var telemetry = domainObject &&
50-
domainObject.getCapability('telemetry'),
51-
metadata = telemetry ? telemetry.getMetadata() : {},
52-
ranges = metadata.ranges || [];
53-
54-
return ranges.some(function (range) {
55-
return range.format === 'string';
56-
});
57-
}
58-
$scope.$watch('domainObject', function (domainObject) {
59-
//When a domain object becomes available, check whether the
60-
// view should auto-scroll to the bottom.
61-
if (domainObject && hasStringTelemetry(domainObject)) {
62-
$scope.autoScroll = true;
63-
}
64-
});
6542
}
6643

6744
RealtimeTableController.prototype = Object.create(TableController.prototype);

platform/features/table/test/controllers/RealtimeTableControllerSpec.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -155,13 +155,6 @@ define(
155155
expect(mockScope.rows[0].row).toBe(1);
156156
});
157157
});
158-
159-
it('enables autoscroll for event telemetry', function () {
160-
controller.subscribe();
161-
mockScope.$watch.mostRecentCall.args[1](mockDomainObject);
162-
expect(mockScope.autoScroll).toBe(true);
163-
});
164-
165158
});
166159
}
167160
);

0 commit comments

Comments
 (0)