diff --git a/www/app/spot/spot/spot.controller.js b/www/app/spot/spot/spot.controller.js index cdf63173..d302b5cf 100644 --- a/www/app/spot/spot/spot.controller.js +++ b/www/app/spot/spot/spot.controller.js @@ -29,6 +29,7 @@ vm.featureLevelTags = []; vm.featureLevelTagsToDisplay = []; vm.mineralTags = []; + vm.minerals = false; vm.selectedType = 'all'; vm.spotLevelTags = []; vm.spotLevelTagsToDisplay = []; @@ -286,6 +287,8 @@ function createTag() { vm.addTagModal.hide(); var id = HelpersFactory.getNewId(); + $log.log($state.current.name); + if ($state.current.name === 'app.spotTab.minerals') TagFactory.setIsMineralsTag(true); vm.submit('/app/tags/' + id); } diff --git a/www/app/tag/tag.controller.js b/www/app/tag/tag.controller.js index 76b77a6c..f6a2893c 100644 --- a/www/app/tag/tag.controller.js +++ b/www/app/tag/tag.controller.js @@ -320,7 +320,11 @@ var id = $state.params.tag_id; vm.data = ProjectFactory.getTag(id); vm.data.id = id; // Just in case vm.tag is undefined - + var isMineralsTag = TagFactory.getIsMineralsTag(); + if (isMineralsTag) { + vm.data.type = 'mineral'; + TagFactory.setIsMineralsTag(false); + } if (vm.data.color) vm.color = vm.data.color; if (vm.data.type === 'geologic_unit') FormFactory.setForm('rock_unit'); diff --git a/www/app/tag/tag.factory.js b/www/app/tag/tag.factory.js index 237c0609..28846441 100644 --- a/www/app/tag/tag.factory.js +++ b/www/app/tag/tag.factory.js @@ -12,6 +12,7 @@ var activeTags = []; var isActiveTagging = false; var tagTypeLabels = {}; + var isMineralTag = false; activate(); @@ -23,13 +24,15 @@ 'getActiveTags': getActiveTags, 'getAddNewActiveTag': getAddNewActiveTag, 'getGeologicUnits': getGeologicUnits, + 'getIsMineralsTag': getIsMineralsTag, 'getNumTaggedFeatures': getNumTaggedFeatures, 'getTagTypeLabel': getTagTypeLabel, 'removeActiveTag': removeActiveTag, 'removeActiveTagging': removeActiveTagging, 'setActiveTagging': setActiveTagging, 'setActiveTags': setActiveTags, - 'setAddNewActiveTag': setAddNewActiveTag + 'setAddNewActiveTag': setAddNewActiveTag, + 'setIsMineralsTag': setIsMineralsTag }; /** @@ -96,6 +99,10 @@ return addNewActiveTag; } + function getIsMineralsTag() { + return isMineralTag; + } + function getNumTaggedFeatures(tag) { var count = 0; if (tag && tag.features) { @@ -142,5 +149,9 @@ function setAddNewActiveTag(inBool) { addNewActiveTag = inBool; } + + function setIsMineralsTag(inBool) { + isMineralTag = inBool; + } } }());