From d63f7cf5b8a25bba0de8ee11202edda3ca062eb4 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Sat, 27 Feb 2016 21:59:27 +0100 Subject: Desktop search fields --- tpl/default/js/shaarli.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'tpl/default/js') diff --git a/tpl/default/js/shaarli.js b/tpl/default/js/shaarli.js index c401af1d..cbce0617 100644 --- a/tpl/default/js/shaarli.js +++ b/tpl/default/js/shaarli.js @@ -39,4 +39,14 @@ }); window.addEventListener(WINDOW_CHANGE_EVENT, closeMenu); -})(this, this.document); \ No newline at end of file +})(this, this.document); + +var searchInputs = document.querySelectorAll('#search input[type="text"]'); +[].forEach.call(searchInputs, function(searchInput) { + searchInput.addEventListener('focus', function(event) { + event.target.style.width = '250px'; + }); + searchInput.addEventListener('blur', function(event) { + event.target.style.width = '140px'; + }); +}); \ No newline at end of file -- cgit v1.2.3