PATH:
home
/
letacommog
/
letaweb
/
scripts
/
editor
/
ecommerce
/
configuration
/
currency
define([], function() { return function($scope, communication, popup_grid) { var list = $scope.$parent.$parent.list; for(var i = 0;i < list.length;i++) { if(list[i].default) { $scope.defaultCurrency = list[i]; return; } } if(!$scope.defaultCurrency) $scope.defaultCurrency = list[0] || {name:''}; $scope.defaultCurrency.default = true; $scope.changeDefault = function(data) { var list = $scope.$parent.$parent.list; var index = list.indexOf(data); if(!data.default) { if(index < list.length - 1 ) { list[index + 1].default = true; } else list[0].default = true; } else { for(var i = 0;i < list.length;i++) { if(i != index) list[i].default = false; } $scope.defaultCurrency = data; data.value = 1; } console.log(list); } } });
[+]
..
[-] edit.js
[edit]