]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-8945 - [verto_communicator] don't show preview settings during video call
authorDavide Colombo <dcolombo@voismart.it>
Wed, 16 Mar 2016 09:32:39 +0000 (10:32 +0100)
committerDavide Colombo <dcolombo@voismart.it>
Fri, 18 Mar 2016 09:13:00 +0000 (10:13 +0100)
html5/verto/verto_communicator/src/partials/modal_settings.html
html5/verto/verto_communicator/src/vertoControllers/controllers/ModalSettingsController.js

index 5df157329275a3c94c05c7ae7600a907fa926fdd..e4aa9021f150d2803060be53995c474bd963d898 100644 (file)
@@ -35,7 +35,7 @@
     </select>
   </div>
 
-  <a class="btn btn-primary" href="#/preview" ng-click="ok()">Preview Settings</a>
+  <a class="btn btn-primary" href="" ng-click="showPreview()">Preview Settings</a>
   <a class="btn btn-primary" href="" ng-click="refreshDeviceList()">Refresh device list</a>
 
   <div class="form-group">
index a99fefe0585dbf631fb11dedb0cbc99a15dfa626..34fa507a35e7def8efd20ffdcbe5889581b691d2 100644 (file)
@@ -4,8 +4,8 @@
   angular
     .module('vertoControllers')
     .controller('ModalSettingsController', ['$scope', '$http',
-      '$location', '$modalInstance', '$rootScope', 'storage', 'verto',
-      function($scope, $http, $location, $modalInstance, $rootScope, storage, verto) {
+      '$location', '$modalInstance', '$rootScope', 'storage', 'verto', 'toastr',
+      function($scope, $http, $location, $modalInstance, $rootScope, storage, verto, toastr) {
         console.debug('Executing ModalSettingsController.');
 
         $scope.storage = storage;
           return verto.refreshDevices();
         };
 
+        $scope.showPreview = function() {
+         $modalInstance.close('Ok.');
+         if (!verto.data.call) {
+           $location.path('/preview');
+           return;
+         }
+         else {
+           toastr.warning('Can\'t display preview settings during a call');
+         }
+        };
+
         $scope.testSpeed = function() {
           return verto.testSpeed(cb);