Skip to content
Snippets Groups Projects
Select Git revision
  • 06f02cf37b75732a04f2d616c84f7752009789f5
  • master default protected
  • traduccio_barbara
  • Catalan-translation
  • feature/cesium_plus_pod_2
  • feature/add_pubkey_icon
  • feature/startup_node_selection
  • develop
  • feature/android_api_19
  • Vivakvo/cesium-patch-8
  • gitlab_migration_1
  • dev
  • rml8
  • v1.6.12
  • v1.6.11
  • v1.6.10
  • v1.6.9
  • v1.6.8
  • v1.6.7
  • v1.6.6
  • v1.6.5
  • v1.6.4
  • v1.6.3
  • v1.6.2
  • v1.6.2-alpha
  • v1.6.1
  • v1.6.0
  • v1.5.12
  • v1.5.11
  • v1.5.10
  • v1.5.9
  • v1.5.8
  • v1.5.7
33 results

join-controllers.js

Blame
  • Forked from clients / Cesium-grp / Cesium
    Source project has a limited visibility.
    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();