diff --git a/front-ui/app/components/search/searchResultsPage.js b/front-ui/app/components/search/searchResultsPage.js index f86538a..fc86fe9 100644 --- a/front-ui/app/components/search/searchResultsPage.js +++ b/front-ui/app/components/search/searchResultsPage.js @@ -14,16 +14,21 @@ var SearchResultsPage = React.createClass({ return SearchStore.getSearchResultsState(); }, render: function() { + var content; + + if (this.state.items.length > 0) { + content = + } else { + + content =
Nema rezultata za vašu pretragu.
+ } return ( -
-

Resultati pretrage za {this.state.q}

+
+

Rezultati pretrage za '{this.state.q}'

- - -
- + {content} +
); - }, componentWillReceiveProps: function() { this.update(); diff --git a/front-ui/app/components/shared/searchBox.js b/front-ui/app/components/shared/searchBox.js index bf2ef07..895ac4b 100644 --- a/front-ui/app/components/shared/searchBox.js +++ b/front-ui/app/components/shared/searchBox.js @@ -10,7 +10,7 @@ var SearchBox = React.createClass({ return SearchStore.getSearchBoxState(); }, onSearchClick: function(e) { - NavigationActions.goToSearchResults(this.state.q); + this.doSearch(); e.preventDefault(); }, componentDidMount: function() { @@ -25,12 +25,17 @@ var SearchBox = React.createClass({ } }, onSearchBoxChange: function(e) { - SearchActions.searchBoxChange(e.currentTarget.value); + SearchActions.searchBoxChange(e.currentTarget.value); + }, + doSearch: function() { + if(this.state.q.trim() !== '') { + NavigationActions.goToSearchResults(this.state.q); + } }, onKeyPress: function(e) { var enterKeyCode = 13; if(e.which == enterKeyCode) { - NavigationActions.goToSearchResults(this.state.q); + this.doSearch(); } }, render: function() { diff --git a/front-ui/app/css/main.css b/front-ui/app/css/main.css index e3d7afc..0981f78 100644 --- a/front-ui/app/css/main.css +++ b/front-ui/app/css/main.css @@ -1,7 +1,9 @@ body { - background-image: url(https://res.cloudinary.com/lfvt7ps2n/image/upload/v1424608718/http_diapers.q-assets.com_images_body_bg_towkjs.gif); + /*background-image: url(https://res.cloudinary.com/lfvt7ps2n/image/upload/v1424608718/http_diapers.q-assets.com_images_body_bg_towkjs.gif);*/ + background-image : url(http://www.windeln.de/resources/img/bg.svg); font-family: Arial, Helvetica, sans-serif; font-size: 12px; + height:100%; } .container { background-color: #fff;