Wrapped function calls inside a new function 'refreshCollections':
- 'getExpandedCollectionNames'
- 'expandCollectionByName'
Change-Id: I2de779a1e93cedf84bb5246a4c3f03acc525e349
Signed-off-by: Martin Péter Lakatoš <martin.lakatos@pantheon.tech>
vm.init = init;
vm.loadRequests = loadRequests;
vm.readCollectionFromFile = readCollectionFromFile;
vm.init = init;
vm.loadRequests = loadRequests;
vm.readCollectionFromFile = readCollectionFromFile;
+ vm.refreshCollections = refreshCollections;
vm.selectAllRequests = selectAllRequests;
vm.selectRequest = selectRequest;
vm.showData = showData;
vm.selectAllRequests = selectAllRequests;
vm.selectRequest = selectRequest;
vm.showData = showData;
- * Dialog for delete collection
+ * Dialog for deleting collection and refreshing collections
* @param ev
* @param collObj
*/
* @param ev
* @param collObj
*/
ev.stopPropagation();
vm.collectionList.deleteCollection(collObj);
vm.collectionList.saveToStorage();
ev.stopPropagation();
vm.collectionList.deleteCollection(collObj);
vm.collectionList.saveToStorage();
- var collectionNames = vm.collectionList.getExpandedCollectionNames();
- $scope.rootBroadcast('YANGMAN_REFRESH_AND_EXPAND_COLLECTIONS', null, function(){
- vm.collectionList.expandCollectionByNames(collectionNames);
- });
function changeCollectionName(names){
vm.collectionList.renameCollection(names[0], names[1]);
vm.collectionList.saveToStorage();
function changeCollectionName(names){
vm.collectionList.renameCollection(names[0], names[1]);
vm.collectionList.saveToStorage();
- var collectionNames = vm.collectionList.getExpandedCollectionNames();
- $scope.rootBroadcast('YANGMAN_REFRESH_AND_EXPAND_COLLECTIONS', null, function(){
- vm.collectionList.expandCollectionByNames(collectionNames);
- });
- * Create collection duplicate and save
+ * Create collection duplicate, save and refresh collections
* @param {array} names 0. element is old name, 1. element is new name
*/
function duplicateCollection(names){
vm.collectionList.duplicateCollection(names[0], names[1]);
vm.collectionList.saveToStorage();
* @param {array} names 0. element is old name, 1. element is new name
*/
function duplicateCollection(names){
vm.collectionList.duplicateCollection(names[0], names[1]);
vm.collectionList.saveToStorage();
- var collectionNames = vm.collectionList.getExpandedCollectionNames();
- $scope.rootBroadcast('YANGMAN_REFRESH_AND_EXPAND_COLLECTIONS', null, function(){
- vm.collectionList.expandCollectionByNames(collectionNames);
- });
+ /**
+ * Refresh and expand collections
+ */
+ function refreshCollections(){
+ var collectionNames = vm.collectionList.getExpandedCollectionNames();
+ $scope.rootBroadcast('YANGMAN_REFRESH_AND_EXPAND_COLLECTIONS', null, function(){
+ vm.collectionList.expandCollectionByNames(collectionNames);
+ });
+ }
+