(function() {
	'use strict';
	
	angular
		.module('app.matchday')
		.controller('UpdateRankMatchday', UpdateRankMatchday);

	function UpdateRankMatchday(initData, $scope, $rootScope, $modal) {
		$rootScope.$broadcast('state-btn', 'updaterank');
		$rootScope.$broadcast('show-phase-nav', false);

		var vm = this;
		vm.currWeek = null;
		vm.maxWeek =  0;
		vm.currWeek = 0;
		vm.modalInstance = null;

		vm.openModal = openModal;
		vm.closeModal = closeModal;
		vm.doUpdateRank = doUpdateRank;

		activate();
		function activate(){
			vm.maxWeek = initData.matchdayModelView.week.weekNumber;
			vm.maxWeek = parseInt(vm.maxWeek);
			vm.currWeek = vm.maxWeek;
		}

		function doUpdateRank() {
			vm.modalInstance.dismiss('cancel');
		}

		function closeModal() {
			vm.modalInstance.dismiss('cancel');
		}

		function openModal() {
			vm.modalInstance = $modal.open({
				templateUrl: 'editScore.html',
				size: 'sm',
				scope: $scope
			});
		}

	}
})();

(function() {
	'use strict';
	
	angular
		.module('app.matchday')
		.controller('UpdateRankMatchday', UpdateRankMatchday);

	function UpdateRankMatchday(initData, $scope, $rootScope, $modal) {
		$rootScope.$broadcast('state-btn', 'updaterank');
		$rootScope.$broadcast('show-phase-nav', false);

		var vm = this;
		vm.currWeek = null;
		vm.maxWeek =  0;
		vm.currWeek = 0;
		vm.modalInstance = null;

		vm.openModal = openModal;
		vm.closeModal = closeModal;
		vm.doUpdateRank = doUpdateRank;

		activate();
		function activate(){
			vm.maxWeek = initData.matchdayModelView.week.weekNumber - 1;
			vm.maxWeek = parseInt(vm.maxWeek);
			vm.currWeek = vm.maxWeek;
		}

		function doUpdateRank() {
			vm.modalInstance.dismiss('cancel');
		}

		function closeModal() {
			vm.modalInstance.dismiss('cancel');
		}

		function openModal() {
			vm.modalInstance = $modal.open({
				templateUrl: 'editScore.html',
				size: 'sm',
				scope: $scope
			});
		}

	}
})();

Change the order of the update matchday menu
Change the order of the update matchday menu
