From 9cfd76cb10d98b488619811a02e2d6af2f86440c Mon Sep 17 00:00:00 2001 From: s2 Date: Sat, 19 May 2018 17:19:22 +0200 Subject: [PATCH] style search --- app/css/app.css | 30 ++++++++++++++++++++++++++++++ app/js/index.js | 3 +-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/app/css/app.css b/app/css/app.css index 56386c67..8a6c17df 100644 --- a/app/css/app.css +++ b/app/css/app.css @@ -1,3 +1,33 @@ .js-container { margin: 5px; } + +/* +* .electron-in-page-search-window is a class specified to default +* element for search window. +*/ +.electron-in-page-search-window { + position: fixed; + top: 0; + right: 0; + border: solid grey 1px; + background-color: white; + width: 300px; + height: 36px; +} + +/* +* .search-inactive is added to search window when the window +* is inactive. +*/ +.search-inactive { + visibility: hidden; +} + +/* +* .search-inactive is added to search window when the window +* is active. +*/ +.search-active { + visibility: visible; +} diff --git a/app/js/index.js b/app/js/index.js index 6caa450a..a709782a 100644 --- a/app/js/index.js +++ b/app/js/index.js @@ -3,7 +3,7 @@ const searchInPage = require('electron-in-page-search').default; const remote = require('electron').remote; - let inPageSearch = searchInPage(); + const inPageSearch = searchInPage(remote.getCurrentWebContents()); //events @@ -70,7 +70,6 @@ if (inPageSearch && inPageSearch.opened) { inPageSearch.closeSearchWindow(); } else { - inPageSearch.searchTarget = remote.getCurrentWebContents(); inPageSearch.openSearchWindow(); } }