Explorar o código

On blur exit search if input vaalue is empty

Yuin Chien %!s(int64=6) %!d(string=hai) anos
pai
achega
673d4c9b03
Modificáronse 2 ficheiros con 16 adicións e 0 borrados
  1. 8 0
      docs/index.html
  2. 8 0
      examples/index.html

+ 8 - 0
docs/index.html

@@ -128,6 +128,14 @@
 
 			}
 
+			filterInput.onblur = function ( event ) {
+
+				if(filterInput.value === '') {
+					panel.classList.remove('searchFocused');
+				}
+
+			}
+
 			exitSearchButton.onclick = function( event ) {
 
 				filterInput.value = '';

+ 8 - 0
examples/index.html

@@ -202,6 +202,14 @@
 
 		}
 
+		filterInput.onblur = function ( event ) {
+
+			if(filterInput.value === '') {
+				panel.classList.remove('searchFocused');
+			}
+
+		}
+
 		exitSearchButton.onclick = function( event ) {
 
 			filterInput.value = '';