From 6d687a0d7ba856cfb7dc00171165ef3adc1e34a1 Mon Sep 17 00:00:00 2001 From: Adrian Lara Date: Thu, 17 Jun 2021 15:57:20 -0600 Subject: [PATCH] fix: rescope accept_meters function within upload modal --- .../js/controllers/data_upload_modal_controller.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/seed/static/seed/js/controllers/data_upload_modal_controller.js b/seed/static/seed/js/controllers/data_upload_modal_controller.js index 7143c79f84..bd4db1fd83 100644 --- a/seed/static/seed/js/controllers/data_upload_modal_controller.js +++ b/seed/static/seed/js/controllers/data_upload_modal_controller.js @@ -368,11 +368,6 @@ angular.module('BE.seed.controller.data_upload_modal', []) break; } - $scope.accept_meters = function (file_id, cycle_id) { - $scope.uploader.in_progress = true; - save_raw_assessed_data(file_id, cycle_id, true); - }; - // $apply() or $digest() needed maybe because of this: // https://github.com/angular-ui/bootstrap/issues/1798 // otherwise alert doesn't show unless modal is interacted with @@ -381,6 +376,13 @@ angular.module('BE.seed.controller.data_upload_modal', []) }); }; + $scope.accept_meters = function (file_id, cycle_id) { + file_id = file_id || $scope.dataset.import_file_id; + cycle_id = cycle_id || $scope.selectedCycle.id; + $scope.uploader.in_progress = true; + save_raw_assessed_data(file_id, cycle_id, true); + }; + /** * save_map_match_PM_data: saves, maps, and matches PM data *