Select Git revision
join-controllers.js
Forked from
clients / Cesium-grp / Cesium
Source project has a limited visibility.
-
ArnaudCerisier authored
Join: remove focus (bug on Firefox) - fix issue #464
ArnaudCerisier authoredJoin: remove focus (bug on Firefox) - fix issue #464
join-controllers.js 12.51 KiB
angular.module('cesium.join.controllers', ['cesium.services'])
.config(function($stateProvider) {
'ngInject';
$stateProvider
.state('app.join', {
url: "/join",
views: {
'menuContent': {
templateUrl: "templates/home/home.html",
controller: 'JoinCtrl'
}
}
})
;
})
.controller('JoinCtrl', JoinController)
.controller('JoinChooseAccountTypeModalCtrl', JoinChooseAccountTypeModalController)
.controller('JoinModalCtrl', JoinModalController)
;
function JoinController($timeout, Modals) {
'ngInject';
// Open join modal
$timeout(function() {
Modals.showJoin();
}, 100);
}
function JoinChooseAccountTypeModalController($scope, $state, Modals, UIUtils, csCurrency) {
'ngInject';
$scope.formData = {};
$scope.slides = {
slider: null,
options: {
loop: false,
effect: 'slide',
speed: 500
}
};
$scope.loading = true;
$scope.load = function() {
if ($scope.loading) {
return csCurrency.get()
.then(function (currency) {
if (!currency) return;
$scope.currency = currency;
$scope.formData.currency = currency.name;
$scope.loading = false;
})
.catch(UIUtils.onError('ERROR.GET_CURRENCIES_FAILED'));
}
};
$scope.$on('modal.shown', $scope.load);
$scope.$on("$ionicSlides.sliderInitialized", function(event, data){
// Disable swipe
data.slider.lockSwipes();
});
$scope.slidePrev = function() {
$scope.slides.slider.unlockSwipes();
$scope.slides.slider.slidePrev();