Merge remote-tracking branch 'origin/master' into private-groups
commit
a5d7fee623
@ -1,5 +1,7 @@
|
|||||||
{
|
{
|
||||||
"results_matching": "%1 result(s) matching \"%2\", (%3 seconds)",
|
"results_matching": "%1 result(s) matching \"%2\", (%3 seconds)",
|
||||||
"no-matches": "No matches found",
|
"no-matches": "No matches found",
|
||||||
"in": "In"
|
"in": "In",
|
||||||
|
"by": "By",
|
||||||
|
"posted-by": "Posted by"
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,26 @@
|
|||||||
|
'use strict';
|
||||||
|
/* globals define, translator, templates */
|
||||||
|
|
||||||
|
define('sort', function() {
|
||||||
|
var module = {};
|
||||||
|
|
||||||
|
module.handleSort = function (field, method, gotoOnSave) {
|
||||||
|
var threadSort = $('.thread-sort');
|
||||||
|
threadSort.find('i').removeClass('fa-check');
|
||||||
|
var currentSetting = threadSort.find('a[data-sort="' + config[field] + '"]');
|
||||||
|
currentSetting.find('i').addClass('fa-check');
|
||||||
|
|
||||||
|
$('.thread-sort').on('click', 'a', function() {
|
||||||
|
var newSetting = $(this).attr('data-sort');
|
||||||
|
socket.emit(method, newSetting, function(err) {
|
||||||
|
if (err) {
|
||||||
|
return app.alertError(err.message);
|
||||||
|
}
|
||||||
|
config[field] = newSetting;
|
||||||
|
ajaxify.go(gotoOnSave);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
return module;
|
||||||
|
});
|
Loading…
Reference in New Issue