summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPliable Pixels <pliablepixels@gmail.com>2016-10-11 16:15:21 -0400
committerPliable Pixels <pliablepixels@gmail.com>2016-10-11 16:15:21 -0400
commit0daca364349874a56712cf1b0a6281b1ff893bed (patch)
tree164067e0a5667db60d88f48c3d15126810934d7f
parent0202d7298986ab02cb1571751d7261ab8afc5f42 (diff)
wait for sendCmd using promise value
Former-commit-id: f1304de74f911c2e876b06f115877a03270fde1f
-rw-r--r--www/js/EventModalCtrl.js12
1 files changed, 4 insertions, 8 deletions
diff --git a/www/js/EventModalCtrl.js b/www/js/EventModalCtrl.js
index ce745716..d91986aa 100644
--- a/www/js/EventModalCtrl.js
+++ b/www/js/EventModalCtrl.js
@@ -389,14 +389,10 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro
//console.log("YOU changed " + $scope.sliderProgress.progress);
$scope.currentProgress.progress = $scope.sliderProgress.progress;
- $timeout(function () {
- sendCommand('14', $scope.connKey, '&offset=' + $scope.currentProgress.progress);
- }, 500);
- // give this command some time to complete
- $timeout(function () {
- $scope.blockSlider = false;
- }, 1500);
-
+ sendCommand('14', $scope.connKey, '&offset=' + $scope.currentProgress.progress)
+ .then (function (s) { $scope.blockSlider = false; }, function (e) {$scope.blockSlider = false;});
+
+
};