[bug] fix search not matching name with or without spaces

This commit is contained in:
Kuldeep M 2019-07-22 08:03:24 +01:00
parent 1cc6e9b313
commit 381934634f
3 changed files with 3 additions and 3 deletions

View File

@ -43,7 +43,7 @@ var search = (function() {
searchedBookmarks.total = bookmarks.get().length; searchedBookmarks.total = bookmarks.get().length;
bookmarks.get().forEach(function(arrayItem, index) { bookmarks.get().forEach(function(arrayItem, index) {
var matchUrl = (arrayItem.url != null) && (arrayItem.url.replace(/^https?\:\/\//i, "").replace(/\/$/, "").toLowerCase().includes(searchInput.value.toLowerCase().replace(/\s/g, ""))); var matchUrl = (arrayItem.url != null) && (arrayItem.url.replace(/^https?\:\/\//i, "").replace(/\/$/, "").toLowerCase().includes(searchInput.value.toLowerCase().replace(/\s/g, "")));
var matchName = (arrayItem.name != null) && (arrayItem.name.toLowerCase().includes(searchInput.value.toLowerCase().replace(/\s/g, ""))); var matchName = (arrayItem.name != null) && (arrayItem.name.toLowerCase().replace(/\s/g, "").includes(searchInput.value.toLowerCase().replace(/\s/g, "")));
if (matchUrl || matchName) { if (matchUrl || matchName) {
var bookmarkDataCopy = JSON.parse(JSON.stringify(arrayItem)); var bookmarkDataCopy = JSON.parse(JSON.stringify(arrayItem));
searchedBookmarks.matching.push(bookmarkDataCopy); searchedBookmarks.matching.push(bookmarkDataCopy);

View File

@ -1,6 +1,6 @@
var version = (function() { var version = (function() {
var current = "3.61.0"; var current = "3.61.1";
var compare = function(a, b) { var compare = function(a, b) {
var pa = a.split("."); var pa = a.split(".");

View File

@ -2,7 +2,7 @@
"name": "nightTab", "name": "nightTab",
"short_name": "nightTab", "short_name": "nightTab",
"description": "A neutral new tab page accented with a chosen colour. Customise the layout, style, background and bookmarks in nightTab.", "description": "A neutral new tab page accented with a chosen colour. Customise the layout, style, background and bookmarks in nightTab.",
"version": "3.61.0", "version": "3.61.1",
"manifest_version": 2, "manifest_version": 2,
"chrome_url_overrides": { "chrome_url_overrides": {
"newtab": "index.html" "newtab": "index.html"