|
|
@ -17,7 +17,7 @@ define('forum/search', ['search', 'autocomplete', 'storage'], function (searchMo
|
|
|
|
|
|
|
|
|
|
|
|
$('#advanced-search').off('submit').on('submit', function (e) {
|
|
|
|
$('#advanced-search').off('submit').on('submit', function (e) {
|
|
|
|
e.preventDefault();
|
|
|
|
e.preventDefault();
|
|
|
|
searchModule.query(getSearchData(), function () {
|
|
|
|
searchModule.query(getSearchDataFromDOM(), function () {
|
|
|
|
$('#search-input').val('');
|
|
|
|
$('#search-input').val('');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
@ -30,7 +30,7 @@ define('forum/search', ['search', 'autocomplete', 'storage'], function (searchMo
|
|
|
|
fillOutForm();
|
|
|
|
fillOutForm();
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
function getSearchData() {
|
|
|
|
function getSearchDataFromDOM() {
|
|
|
|
var form = $('#advanced-search');
|
|
|
|
var form = $('#advanced-search');
|
|
|
|
var searchData = {
|
|
|
|
var searchData = {
|
|
|
|
in: $('#search-in').val(),
|
|
|
|
in: $('#search-in').val(),
|
|
|
@ -50,6 +50,11 @@ define('forum/search', ['search', 'autocomplete', 'storage'], function (searchMo
|
|
|
|
searchData.showAs = form.find('#show-as-topics').is(':checked') ? 'topics' : 'posts';
|
|
|
|
searchData.showAs = form.find('#show-as-topics').is(':checked') ? 'topics' : 'posts';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$(window).trigger('action:search.getSearchDataFromDOM', {
|
|
|
|
|
|
|
|
form: form,
|
|
|
|
|
|
|
|
data: searchData,
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
return searchData;
|
|
|
|
return searchData;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -146,7 +151,7 @@ define('forum/search', ['search', 'autocomplete', 'storage'], function (searchMo
|
|
|
|
|
|
|
|
|
|
|
|
function handleSavePreferences() {
|
|
|
|
function handleSavePreferences() {
|
|
|
|
$('#save-preferences').on('click', function () {
|
|
|
|
$('#save-preferences').on('click', function () {
|
|
|
|
storage.setItem('search-preferences', JSON.stringify(getSearchData()));
|
|
|
|
storage.setItem('search-preferences', JSON.stringify(getSearchDataFromDOMFromDOM()));
|
|
|
|
app.alertSuccess('[[search:search-preferences-saved]]');
|
|
|
|
app.alertSuccess('[[search:search-preferences-saved]]');
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
});
|
|
|
|