Skip to content

Commit

Permalink
fixed #68
Browse files Browse the repository at this point in the history
  • Loading branch information
joefutrelle committed Sep 18, 2015
1 parent 9875f43 commit 4ab98c2
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions rbac/admin/timeseries/TimeSeries.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


ifcbAdmin.controller('TimeSeriesCtrl', ['$scope', 'TimeSeriesService', function ($scope, TimeSeriesService) {
ifcbAdmin.controller('TimeSeriesCtrl', ['$scope', 'Restangular', 'TimeSeriesService', function ($scope, Restangular, TimeSeriesService) {

// initialize local scope
$scope.alert = null;
Expand Down Expand Up @@ -50,14 +50,16 @@ ifcbAdmin.controller('TimeSeriesCtrl', ['$scope', 'TimeSeriesService', function
$scope.saveTimeSeries = function(ts) {
console.log("saving time series "+ts.label);
// remove blank paths before save
for (var i = 0; i < ts.data_dirs.length; i++) {
if (ts.data_dirs[i].path.trim() == "") {
$scope.removePath(ts, ts.data_dirs[i]);
}
}
$.each(ts.data_dirs, function(ix, dd) {
if(dd.path.trim()=="") {
$scope.removePath(ts, dd);
} else {
console.log(ts.label+" has "+dd.product_type+" path "+dd.path);
}
});
if(ts.id) {
// timeseries group already exists on server. update.
ts.patch().then(function(serverResponse) {
Restangular.copy(ts).patch().then(function(serverResponse) {
delete ts.edit;
delete restore[ts.id];
$scope.alert = null;
Expand Down

0 comments on commit 4ab98c2

Please sign in to comment.