Skip to content

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

improving tag adding handling by activating tag selection on blur

Ilian19e26d42ba30
diff --git a/data/js/core.ui.js b/data/js/core.ui.js
index e7973e943..003defd2a 100644
--- a/data/js/core.ui.js
+++ b/data/js/core.ui.js
@@ -67,7 +67,8 @@ define(function(require, exports, module) {
multiple: true,
tags: TSCORE.Config.getAllTags(),
tokenSeparators: [",", " "],
- minimumInputLength: 2
+ minimumInputLength: 2,
+ selectOnBlur: true,
});
$("#newFileName").val("");
@@ -100,15 +101,6 @@ define(function(require, exports, module) {
var showTagEditDialog = function() {
$( "#newTagName" ).val(TSCORE.selectedTag);
-
- /* $( "#newTagName" ).select2('data', null);
- $( "#newTagName" ).select2({
- multiple: false,
- tags: TSCORE.Config.getAllTags(),
- tokenSeparators: [",", " "],
- minimumInputLength: 2
- }); */
-
$( '#dialogEditTag' ).modal({backdrop: 'static',show: true});
};
diff --git a/data/js/tags.ui.js b/data/js/tags.ui.js
index d08379e66..3ca776efd 100644
--- a/data/js/tags.ui.js
+++ b/data/js/tags.ui.js
@@ -409,24 +409,6 @@ define(function(require, exports, module) {
return tagStyle;
}
- // Helper function generating file extension button
- /*function generateExtButton(fileExtension, filePath) {
- //console.log("Creating ext button...");
- var wrapper = $('<span>');
- if(fileExtension.length > 0) {
- wrapper.append($('<button>', {
- title: "Opens context menu for "+fileExtension,
- tag: fileExtension,
- filepath: filePath,
- "class": "btn btn-sm extTagButton",
- text: fileExtension+" "
- })
- .append("<span class='caret'/>")
- );
- }
- return wrapper.html();
- }*/
-
function showDialogTagCreate() {
$( "#newTagTitle" ).val("");
$( '#dialogTagCreate' ).modal({backdrop: 'static',show: true});
@@ -477,6 +459,7 @@ define(function(require, exports, module) {
tags: TSCORE.Config.getAllTags(),
tokenSeparators: [",", " "],
minimumInputLength: 2,
+ selectOnBlur: true,
});
$( '#dialogAddTags' ).modal({show: true});