@@ -23,7 +23,7 @@ export default (mios: MiOS) => {
|
||||
route('/i/settings/authorized-apps', settingsAuthorizedApps);
|
||||
route('/post/new', newPost);
|
||||
route('/post::post', post);
|
||||
route('/search::query', search);
|
||||
route('/search', search);
|
||||
route('/:user', user.bind(null, 'overview'));
|
||||
route('/:user/graphs', user.bind(null, 'graphs'));
|
||||
route('/:user/followers', userFollowers);
|
||||
@@ -83,7 +83,7 @@ export default (mios: MiOS) => {
|
||||
|
||||
function search(ctx) {
|
||||
const el = document.createElement('mk-search-page');
|
||||
el.setAttribute('query', ctx.params.query);
|
||||
el.setAttribute('query', ctx.querystring.substr(2));
|
||||
mount(el);
|
||||
}
|
||||
|
||||
|
@@ -15,6 +15,8 @@
|
||||
width calc(100% - 32px)
|
||||
</style>
|
||||
<script>
|
||||
import parse from '../../common/scripts/parse-search-query';
|
||||
|
||||
this.mixin('api');
|
||||
|
||||
this.max = 30;
|
||||
@@ -24,9 +26,7 @@
|
||||
this.withMedia = this.opts.withMedia;
|
||||
|
||||
this.init = new Promise((res, rej) => {
|
||||
this.api('posts/search', {
|
||||
query: this.query
|
||||
}).then(posts => {
|
||||
this.api('posts/search', parse(this.query)).then(posts => {
|
||||
res(posts);
|
||||
this.trigger('loaded');
|
||||
});
|
||||
|
@@ -413,7 +413,7 @@
|
||||
this.search = () => {
|
||||
const query = window.prompt('%i18n:mobile.tags.mk-ui-nav.search%');
|
||||
if (query == null || query == '') return;
|
||||
this.page('/search:' + query);
|
||||
this.page('/search?q=' + encodeURIComponent(query));
|
||||
};
|
||||
</script>
|
||||
</mk-ui-nav>
|
||||
|
Reference in New Issue
Block a user