2017-12-13 20:58:05 +09:00
|
|
|
'use strict';
|
|
|
|
|
|
2018-05-08 10:28:13 +02:00
|
|
|
angular.module('copayApp.controllers').controller('servicesController', function($scope, $ionicScrollDelegate, $timeout, servicesService, configService) {
|
2017-12-13 20:58:05 +09:00
|
|
|
$scope.hide = false;
|
2018-05-08 10:28:13 +02:00
|
|
|
|
|
|
|
|
configService.whenAvailable(function(config) {
|
|
|
|
|
$scope.hide = config.homeSectionIsHidden&&config.homeSectionIsHidden['services']?config.homeSectionIsHidden['services']:false;
|
|
|
|
|
});
|
|
|
|
|
|
2018-02-14 16:35:57 +00:00
|
|
|
$scope.services = servicesService.get();
|
2017-12-13 20:58:05 +09:00
|
|
|
|
|
|
|
|
$scope.toggle = function() {
|
|
|
|
|
$scope.hide = !$scope.hide;
|
|
|
|
|
$timeout(function() {
|
|
|
|
|
$ionicScrollDelegate.resize();
|
|
|
|
|
$scope.$apply();
|
2018-05-08 10:28:13 +02:00
|
|
|
configService.set({homeSectionIsHidden: {services: $scope.hide}}, function(err) {
|
|
|
|
|
if (err) $log.debug(err);
|
|
|
|
|
});
|
2017-12-13 20:58:05 +09:00
|
|
|
}, 10);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
});
|