From 8694cb2fc249586f8cd78cf9f07cdf280729bdda Mon Sep 17 00:00:00 2001 From: Kuldeep M Date: Wed, 3 Apr 2019 13:10:37 +0100 Subject: [PATCH] [feature] change search placeholder when bookmarks are not shown --- js/control.js | 11 ++++++----- js/search.js | 12 +++++++++--- js/version.js | 2 +- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/js/control.js b/js/control.js index 60728d77..a6ac377b 100644 --- a/js/control.js +++ b/js/control.js @@ -192,7 +192,7 @@ var control = (function() { func: function() { render(); dependents(); - search.update(); + search.render(); } }, { element: helper.e(".control-header-search-engine-duckduckgo"), @@ -201,7 +201,7 @@ var control = (function() { func: function() { render(); dependents(); - search.update(); + search.render(); } }, { element: helper.e(".control-header-search-engine-giphy"), @@ -210,7 +210,7 @@ var control = (function() { func: function() { render(); dependents(); - search.update(); + search.render(); } }, { element: helper.e(".control-header-search-engine-custom"), @@ -219,14 +219,14 @@ var control = (function() { func: function() { render(); dependents(); - search.update(); + search.render(); } }, { element: helper.e(".control-header-search-engine-custom-url"), path: "header.search.engine.custom.url", type: "text", func: function() { - search.update(); + search.render(); } }, { element: helper.e(".control-header-edit-add-show"), @@ -361,6 +361,7 @@ var control = (function() { render(); dependents(); header.render(); + search.render(); } }, { element: helper.e(".control-bookmarks-name-show"), diff --git a/js/search.js b/js/search.js index 24f688e6..6ba56662 100644 --- a/js/search.js +++ b/js/search.js @@ -60,8 +60,14 @@ var search = (function() { }; }; - var update = function() { + var render = function() { var search = helper.e(".search"); + var searchInput = helper.e(".search-input"); + if (state.get().bookmarks.link.show) { + searchInput.setAttribute("placeholder", "Find or Search"); + } else { + searchInput.setAttribute("placeholder", "Search"); + }; search.setAttribute("action", state.get().header.search.engine[state.get().header.search.engine.selected].url); }; @@ -83,7 +89,7 @@ var search = (function() { var init = function() { bind(); - update(); + render(); _focus(); }; @@ -91,7 +97,7 @@ var search = (function() { return { init: init, get: get, - update: update, + render: render, clear: clear }; diff --git a/js/version.js b/js/version.js index 1504a2d7..2d5ca290 100644 --- a/js/version.js +++ b/js/version.js @@ -1,7 +1,7 @@ var version = (function() { // version is normally bumped when the state needs changing or any new functionality is added - var current = "2.14.0"; + var current = "2.15.0"; var compare = function(a, b) { var pa = a.split(".");