Skip to content

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

Adding tags to the file properties dialog

Iliandff0e6059025
diff --git a/data/js/fileopener.js b/data/js/fileopener.js
index aa6551bb3..d23e9043a 100644
--- a/data/js/fileopener.js
+++ b/data/js/fileopener.js
@@ -19,6 +19,8 @@
var _tsEditor;
+ var generatedTagButtons;
+
$.fn.editableform.buttons =
'<button type="submit" class="btn btn-primary editable-submit" style="margin-left: 8px;"><i class="fa fa-check fa-lg"></i></button>'+
'<br /><br /><button type="button" class="btn editable-cancel"><i class="fa fa-times fa-lg"></i></button>';
@@ -391,8 +393,9 @@
} else {
tagString = tagString + "," +value;
}
- });
- $( "#fileTags" ).empty().append(TSCORE.generateTagButtons(tagString,_openedFilePath));
+ });
+ generatedTagButtons = TSCORE.generateTagButtons(tagString,_openedFilePath);
+ $( "#fileTags" ).empty().append(generatedTagButtons);
$( "#tagsContainer" ).droppable({
greedy: "true",
@@ -489,8 +492,11 @@
$("#filePathProperty").val(_openedFileProperties.path);
$("#fileSizeProperty").val(_openedFileProperties.size);
$("#fileLMDTProperty").val(new Date(_openedFileProperties.lmdt));
- $('#dialogFileProperties').i18n();
- $('#dialogFileProperties').modal({backdrop: 'static',show: true});
+ var $fileTagsProperty = $("#fileTagsProperty");
+ $fileTagsProperty.empty();
+ $fileTagsProperty.append(generatedTagButtons);
+ $fileTagsProperty.find(".caret").hide(); // hiding the dropdown trigger
+ $('#dialogFileProperties').i18n().modal({backdrop: 'static',show: true});
});
}
diff --git a/data/templates/FilePropertiesDialog.html b/data/templates/FilePropertiesDialog.html
index bf3efb1b2..c8e424f70 100644
--- a/data/templates/FilePropertiesDialog.html
+++ b/data/templates/FilePropertiesDialog.html
@@ -19,7 +19,11 @@
<div class="form-group">
<label class="control-label" for="fileLMDTProperty" data-i18n="ns.dialogs:filePropertiesLMDT">Last Modified Datetime</label>
<input class="form-control uneditable-input" readonly="true" type="text" name="fileLMDTProperty" id="fileLMDTProperty" />
- </div>
+ </div>
+ <div class="form-group">
+ <label class="control-label" for="fileTagsProperty" data-i18n="ns.dialogs:filePropertiesTags">Tags</label>
+ <span class="form-control" name="fileTagsProperty" id="fileTagsProperty" />
+ </div>
</div>
<div class="modal-footer">
<button class="btn btn-primary" data-dismiss="modal" aria-hidden="true"><i class="fa fa-check fa-lg"></i></button>