diff --git a/Changelog.md b/Changelog.md index 9e7e4cb9e..8c7cc3d52 100644 --- a/Changelog.md +++ b/Changelog.md @@ -33,6 +33,8 @@ * Deleting a post deletes it from Tumblr too [#4331](https://github.com/diaspora/diaspora/pull/4331) * OpenGraph support [#4215](https://github.com/diaspora/diaspora/pull/4215) * Added Wordpress service ability for posts. [#4321](https://github.com/diaspora/diaspora/pull/4321) +* Implement tag search autocomplete in header search box [#4169](https://github.com/diaspora/diaspora/issues/4169) + # 0.1.1.0 diff --git a/app/assets/javascripts/widgets/search.js b/app/assets/javascripts/widgets/search.js index 675b6f8b8..ebe1009fe 100644 --- a/app/assets/javascripts/widgets/search.js +++ b/app/assets/javascripts/widgets/search.js @@ -31,7 +31,11 @@ if (typeof row.search !== "undefined") { return Diaspora.I18n.t("search_for", row); } else { - return "" + row.name; + if (row.avatar) { + return "" + row.name; + } else { + return row.name; + } } }; @@ -62,7 +66,7 @@ window.location = self.searchFormAction + '?' + self.searchInputName + '=' + data['name']; } else { // The actual result self.options.element.val(formatted); - window.location = data['url']; + window.location = data['url'] ? data['url'] : "/tags/" + searchForm.attr('name'); } }; }; diff --git a/app/assets/templates/header_tpl.jst.hbs b/app/assets/templates/header_tpl.jst.hbs index 9733982ed..948617e69 100644 --- a/app/assets/templates/header_tpl.jst.hbs +++ b/app/assets/templates/header_tpl.jst.hbs @@ -103,7 +103,7 @@