|
|
@ -1,16 +1,16 @@
|
|
|
|
'use strict';
|
|
|
|
'use strict';
|
|
|
|
/* globals define, config, socket, app, ajaxify, templates */
|
|
|
|
/* globals define, config, socket, app, ajaxify, templates */
|
|
|
|
|
|
|
|
|
|
|
|
define('sort', function() {
|
|
|
|
define('sort', ['components'], function(components) {
|
|
|
|
var module = {};
|
|
|
|
var module = {};
|
|
|
|
|
|
|
|
|
|
|
|
module.handleSort = function (field, method, gotoOnSave) {
|
|
|
|
module.handleSort = function (field, method, gotoOnSave) {
|
|
|
|
var threadSort = $('.thread-sort');
|
|
|
|
var threadSort = components.get('thread/sort');
|
|
|
|
threadSort.find('i').removeClass('fa-check');
|
|
|
|
threadSort.find('i').removeClass('fa-check');
|
|
|
|
var currentSetting = threadSort.find('a[data-sort="' + config[field] + '"]');
|
|
|
|
var currentSetting = threadSort.find('a[data-sort="' + config[field] + '"]');
|
|
|
|
currentSetting.find('i').addClass('fa-check');
|
|
|
|
currentSetting.find('i').addClass('fa-check');
|
|
|
|
|
|
|
|
|
|
|
|
$('.thread-sort').on('click', 'a', function() {
|
|
|
|
threadSort.on('click', 'a', function() {
|
|
|
|
var newSetting = $(this).attr('data-sort');
|
|
|
|
var newSetting = $(this).attr('data-sort');
|
|
|
|
socket.emit(method, newSetting, function(err) {
|
|
|
|
socket.emit(method, newSetting, function(err) {
|
|
|
|
if (err) {
|
|
|
|
if (err) {
|
|
|
|