Settings modal rework -> panel slider at top

This commit is contained in:
Jaon EarlWolf
2016-01-07 15:50:35 -03:00
parent e840bd9a0b
commit d3b4b49274
7 changed files with 228 additions and 172 deletions

View File

@@ -278,6 +278,12 @@
angular.element('#wrapper').addClass('toggled');
};
$scope.toggleSettings = function() {
var settingsEl = angular.element(document.querySelector('#settings'));
settingsEl.toggleClass('toggled');
$rootScope.$emit('toggledSettings', settingsEl.hasClass('toggled'));
};
$scope.goFullscreen = function() {
if (storage.data.userStatus !== 'connected') {
return;

View File

@@ -3,16 +3,25 @@
angular
.module('vertoControllers')
.controller('ModalSettingsController', ['$scope', '$http',
'$location', '$modalInstance', '$rootScope', 'storage', 'verto', 'toastr',
function($scope, $http, $location, $modalInstance, $rootScope, storage, verto, toastr) {
.controller('SettingsController', ['$scope', '$http',
'$location', '$rootScope', 'storage', 'verto',
function($scope, $http, $location, $rootScope, storage, verto) {
console.debug('Executing ModalSettingsController.');
$.material.init();
$scope.speakerFeature = typeof document.getElementById('webcam').sinkId !== 'undefined';
$scope.storage = storage;
$scope.verto = verto;
$scope.mydata = angular.copy(storage.data);
$scope.speakerFeature = typeof document.getElementById('webcam').sinkId !== 'undefined';
$rootScope.$on('toggledSettings', function(e, status) {
if (status) {
$scope.mydata = angular.copy(storage.data);
} else {
$scope.ok();
}
});
$scope.ok = function() {
if ($scope.mydata.selectedSpeaker != storage.data.selectedSpeaker) {
@@ -24,11 +33,6 @@
if (storage.data.autoBand) {
$scope.testSpeed();
}
$modalInstance.close('Ok.');
};
$scope.cancel = function() {
$modalInstance.dismiss('cancel');
};
$scope.refreshDeviceList = function() {
@@ -60,7 +64,6 @@
if (confirm('Factory Reset Settings?')) {
storage.factoryReset();
$scope.logout();
$modalInstance.close('Ok.');
window.location.reload();
};
};