Skip to content

TagSpaces is an offline, open source, document manager with tagging support

fix geo tagging

kristiyandd95d17befbb2a
diff --git a/data/js/tags.ui.js b/data/js/tags.ui.js
index 7883110c0..73488f200 100644
--- a/data/js/tags.ui.js
+++ b/data/js/tags.ui.js
@@ -158,9 +158,12 @@ define(function(require, exports, module) {
$('#addTagsButton').click(function() {
var tags = $('#tags').val().split(',');
TSCORE.TagUtils.addTag(TSCORE.Utils.getUniqueSelectedFiles(), tags);
- if ($('#tags').val() === 'geo-tag') {
- var tagValue = $('#tags').val();
- TSCORE.UI.showAddTagDialog(tagValue);
+ if (TSCORE.PRO) {
+ tags.forEach(function(value) {
+ if (value === 'geo-tag') {
+ TSCORE.UI.showAddTagDialog(value);
+ }
+ });
}
});
@@ -385,7 +388,8 @@ define(function(require, exports, module) {
var d;
if (tagData.type === 'smart') {
switch (tagData.functionality) {
- case 'geoTagging': {
+ case 'geoTagging':
+ {
$('#viewContainers').on('drop dragend', function(event) {
if (TSCORE.selectedTag === 'geo-tag') {
TSCORE.showTagEditDialog();
@@ -393,23 +397,27 @@ define(function(require, exports, module) {
});
break;
}
- case 'today': {
+ case 'today':
+ {
tagValue = TSCORE.TagUtils.formatDateTime4Tag(new Date(), false);
break;
}
- case 'tomorrow': {
+ case 'tomorrow':
+ {
d = new Date();
d.setDate(d.getDate() + 1);
tagValue = TSCORE.TagUtils.formatDateTime4Tag(d, false);
break;
}
- case 'yesterday': {
+ case 'yesterday':
+ {
d = new Date();
d.setDate(d.getDate() - 1);
tagValue = TSCORE.TagUtils.formatDateTime4Tag(d, false);
break;
}
- case 'currentMonth': {
+ case 'currentMonth':
+ {
var cMonth = '' + (new Date().getMonth() + 1);
if (cMonth.length === 1) {
cMonth = '0' + cMonth;
@@ -417,15 +425,18 @@ define(function(require, exports, module) {
tagValue = '' + new Date().getFullYear() + cMonth;
break;
}
- case 'currentYear': {
+ case 'currentYear':
+ {
tagValue = '' + new Date().getFullYear();
break;
}
- case 'now': {
+ case 'now':
+ {
tagValue = TSCORE.TagUtils.formatDateTime4Tag(new Date(), true);
break;
}
- default: {
+ default:
+ {
break;
}
}