add in-topic search support to dbsearch
prevent multiple click handlers on in-topic search widget(each click was
causing multiple scrolls)
fix index
v1.18.x
Barış Soner Uşaklı 8 years ago
parent e613064b06
commit bca79da8c6

@ -56,7 +56,7 @@
"mousetrap": "^1.5.3",
"nconf": "~0.8.2",
"nodebb-plugin-composer-default": "5.0.1",
"nodebb-plugin-dbsearch": "2.0.4",
"nodebb-plugin-dbsearch": "2.0.5",
"nodebb-plugin-emoji-extended": "1.1.1",
"nodebb-plugin-emoji-one": "1.2.1",
"nodebb-plugin-markdown": "8.0.0",

@ -99,7 +99,7 @@ define('forum/topic', [
function handleTopicSearch() {
require(['search', 'mousetrap'], function (search, mousetrap) {
$('.topic-search')
$('.topic-search').off('click')
.on('click', '.prev', function () {
search.topicDOM.prev();
})

@ -245,7 +245,7 @@ define('navigator', ['forum/pagination', 'components'], function (pagination, co
}
}
var page = Math.max(1, Math.ceil(index / config.postsPerPage));
var page = Math.max(1, Math.ceil((index + 1) / config.postsPerPage));
if (parseInt(page, 10) !== ajaxify.data.pagination.currentPage) {
pagination.loadPage(page, function () {

@ -156,7 +156,7 @@ define('search', ['navigator', 'translator', 'storage'], function (nav, translat
return app.alertError(err.message);
}
nav.scrollToPost(postIndex, true);
nav.scrollToIndex(postIndex, true);
});
} else {
translator.translate('[[search:no-matches]]', function (text) {

Loading…
Cancel
Save