Skip to content

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

small improvements in the search functionality

Ilian Sapundshiev34303c0c488e
diff --git a/data/js/search.js b/data/js/search.js
index 9a14aa067..28ce6aa21 100644
--- a/data/js/search.js
+++ b/data/js/search.js
@@ -290,7 +290,7 @@ define(function(require, exports, module) {
var allTags = [];
data.forEach(function(fileEntry) {
fileEntry.tags.forEach(function(tag) {
- allTags.push(tag.toLowerCase());
+ allTags.push(("" + tag).toLowerCase());
});
});
var countData = _.countBy(allTags, function(obj) {
diff --git a/data/js/search.ui.js b/data/js/search.ui.js
index a6cc7881e..138591a30 100644
--- a/data/js/search.ui.js
+++ b/data/js/search.ui.js
@@ -19,10 +19,6 @@ define(function(require, exports, module) {
} else {
TSCORE.Search.nextQuery = this.value;
}
- if (this.value.length === 0) {
- TSCORE.Search.nextQuery = this.value;
- TSCORE.PerspectiveManager.redrawCurrentPerspective();
- }
}).focus(function(e) {
$("#searchOptions").hide();
});
@@ -178,6 +174,8 @@ define(function(require, exports, module) {
TSCORE.PRO.Search.addQueryToHistory(origSearchVal);
}
TSCORE.Search.nextQuery = $('#searchBox').val();
+ } else {
+ cancelSearch();
}
$('#searchOptions').hide();
TSCORE.PerspectiveManager.redrawCurrentPerspective();