figure out pathname, dont crash if callback isnt supplied

v1.18.x
barisusakli 10 years ago
parent 04be40158c
commit f67053df52

@ -120,7 +120,9 @@ define('forum/groups/details', ['iconSelect', 'vendor/colorpicker/colorpicker',
}
if (settings.name) {
ajaxify.go('groups/' + encodeURIComponent(settings.name));
var pathname = window.location.pathname;
pathname = pathname.substr(1, pathname.lastIndexOf('/'));
ajaxify.go(pathname + encodeURIComponent(settings.name));
} else {
ajaxify.refresh();
}

@ -77,6 +77,7 @@ module.exports = function(redisClient, module) {
};
module.deleteAll = function(keys, callback) {
callback = callback || function() {};
var multi = redisClient.multi();
for(var i=0; i<keys.length; ++i) {
multi.del(keys[i]);
@ -91,16 +92,19 @@ module.exports = function(redisClient, module) {
};
module.set = function(key, value, callback) {
callback = callback || function() {};
redisClient.set(key, value, function(err) {
callback(err);
});
};
module.increment = function(key, callback) {
callback = callback || function() {};
redisClient.incr(key, callback);
};
module.rename = function(oldKey, newKey, callback) {
callback = callback || function() {};
redisClient.rename(oldKey, newKey, function(err, res) {
callback(err);
});

Loading…
Cancel
Save