tweaks to make the ACP work better on tablets, some work on hidden groups

This commit is contained in:
Julian Lam
2013-11-27 20:20:08 -05:00
parent 670986f7ef
commit 69427fa10e
3 changed files with 19 additions and 7 deletions

View File

@@ -150,7 +150,8 @@
gid: gid,
name: name,
description: description,
deleted: '0'
deleted: '0',
hidden: '0'
})
.exec(function (err) {
Groups.get(gid, {}, callback);
@@ -162,6 +163,16 @@
});
};
Groups.hide = function(gid) {
Groups.exists(gid, function(err, exists) {
if (exists) {
Groups.update(gid, {
hidden: '1'
});
}
});
};
Groups.update = function(gid, values, callback) {
RDB.exists('gid:' + gid, function (err, exists) {
if (!err && exists) {
@@ -186,6 +197,7 @@
Groups.getGidFromName(groupName, function(err, gid) {
if (err || !gid) {
Groups.create(groupName, '', function(err, groupObj) {
Groups.hide(groupObj.gid);
Groups.join(groupObj.gid, uid, callback);
});
} else {