12345678910111213141516171819202122232425262728293031 |
- (function()
- {
- angular.module('appSdk')
- .factory('DataShareBusiness', [function () {
-
- var data = {
- Groups: null,
- CurrentGroups: [],
- setCurrentGroup: function(group)
- {
- data.CurrentGroups = [];
- while (group != null) {
- data.CurrentGroups.push(group);
- group = group.Parent;
- }
- data.CurrentGroups.reverse();
- },
- upCurrentGroup: function()
- {
- if (data.CurrentGroups.length > 1) {
- data.setCurrentGroup(data.CurrentGroups[data.CurrentGroups.length - 2]);
- }
- else if (data.CurrentGroups.length == 1) {
- data.setCurrentGroup(null);
- }
- }
- };
-
- return data;
- }]);
- })();
|