You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

DataShareBusiness.js 987B

12345678910111213141516171819202122232425262728293031
  1. (function()
  2. {
  3. angular.module('appSdk')
  4. .factory('DataShareBusiness', [function () {
  5. var data = {
  6. Groups: null,
  7. CurrentGroups: [],
  8. setCurrentGroup: function(group)
  9. {
  10. data.CurrentGroups = [];
  11. while (group != null) {
  12. data.CurrentGroups.push(group);
  13. group = group.Parent;
  14. }
  15. data.CurrentGroups.reverse();
  16. },
  17. upCurrentGroup: function()
  18. {
  19. if (data.CurrentGroups.length > 1) {
  20. data.setCurrentGroup(data.CurrentGroups[data.CurrentGroups.length - 2]);
  21. }
  22. else if (data.CurrentGroups.length == 1) {
  23. data.setCurrentGroup(null);
  24. }
  25. }
  26. };
  27. return data;
  28. }]);
  29. })();