['ConstantsModule', 'diff_viewer']
);
+Loader.directive(
+ 'resultsUpdatedCallbackDirective',
+ ['$timeout',
+ function($timeout) {
+ return function(scope, element, attrs) {
+ if (scope.$last) {
+ $timeout(function() {
+ scope.resultsUpdatedCallback();
+ });
+ }
+ };
+ }
+ ]
+);
+
// TODO(epoger): Combine ALL of our filtering operations (including
// truncation) into this one filter, so that runs most efficiently?
// (We would have to make sure truncation still took place after
Loader.controller(
'Loader.Controller',
- function($scope, $http, $filter, $location, $timeout, constants) {
+ function($scope, $http, $filter, $location, $log, $timeout, constants) {
$scope.constants = constants;
$scope.windowTitle = "Loading GM Results...";
$scope.resultsToLoad = $location.search().resultsToLoad;
$scope.imageSets = data[constants.KEY__IMAGESETS];
$scope.sortColumnSubdict = constants.KEY__DIFFERENCE_DATA;
$scope.sortColumnKey = constants.KEY__DIFFERENCE_DATA__WEIGHTED_DIFF;
- $scope.showTodos = false;
$scope.showSubmitAdvancedSettings = false;
$scope.submitAdvancedSettings = {};
* can be bookmarked.
*/
$scope.updateResults = function() {
+ $scope.renderStartTime = window.performance.now();
+ $log.debug("renderStartTime: " + $scope.renderStartTime);
$scope.displayLimit = $scope.displayLimitPending;
// TODO(epoger): Every time we apply a filter, AngularJS creates
// another copy of the array. Is there a way we can filter out
}
/**
+ * This function is called when the results have been completely rendered
+ * after updateResults().
+ */
+ $scope.resultsUpdatedCallback = function() {
+ $scope.renderEndTime = window.performance.now();
+ $log.debug("renderEndTime: " + $scope.renderEndTime);
+ }
+
+ /**
* Re-sort the displayed results.
*
* @param subdict (string): which subdictionary
<td>
Found {{filteredImagePairs.length}} matches;
<span ng-show="filteredImagePairs.length > limitedImagePairs.length">
- displaying the first {{limitedImagePairs.length}}
+ displaying the first {{limitedImagePairs.length}}.
</span>
<span ng-show="filteredImagePairs.length <= limitedImagePairs.length">
- displaying them all
+ displaying them all.
+ </span>
+ <span ng-show="renderEndTime > renderStartTime">
+ Rendered in {{(renderEndTime - renderStartTime).toFixed(0)}} ms.
</span>
<br>
(click on the column header radio buttons to re-sort by that column)
</th>
</tr>
- <tr ng-repeat="imagePair in limitedImagePairs" ng-controller="ImageController">
+ <tr ng-repeat="imagePair in limitedImagePairs" ng-controller="ImageController" results-updated-callback-directive>
<td>
{{imagePair[constants.KEY__EXTRA_COLUMN_VALUES][constants.KEY__EXTRACOLUMN__RESULT_TYPE]}}
<br>