summaryrefslogtreecommitdiffstats
path: root/settings
diff options
context:
space:
mode:
authorraghunayyar <me@iraghu.com>2014-02-25 15:39:01 +0530
committerArthur Schiwon <blizzz@owncloud.com>2014-06-02 12:53:53 +0200
commit65aa20433c796c40592e6031eb8ba323c171c108 (patch)
tree369e356d673516ddaa879127c192527e8b533fe0 /settings
parent17e640af22d07c5ecede6ae1b6d1a89509e104a9 (diff)
downloadnextcloud-server-65aa20433c796c40592e6031eb8ba323c171c108.tar.gz
nextcloud-server-65aa20433c796c40592e6031eb8ba323c171c108.zip
Enhancement : Toggle Add Group on Click, @blizzz have a look here.
Diffstat (limited to 'settings')
-rw-r--r--settings/css/settings.css5
-rw-r--r--settings/js/users/groups.js18
-rw-r--r--settings/templates/users/part.grouplist.php9
3 files changed, 29 insertions, 3 deletions
diff --git a/settings/css/settings.css b/settings/css/settings.css
index 2f0585f2990..e6ad4fd304f 100644
--- a/settings/css/settings.css
+++ b/settings/css/settings.css
@@ -51,6 +51,11 @@ table.nostyle label { margin-right: 2em; }
table.nostyle td { padding: 0.2em 0; }
/* USERS */
+#newgroup-init a span { margin-left: 20px; }
+#newgroup-init a span:before {
+ position: absolute; left: 12px; top:-2px;
+ content: '+'; font-weight: bold; font-size: 150%;
+}
.usercount { float: left; margin: 5px; }
li.active span.utils .delete {
float: left; position: relative; opacity: 0.5;
diff --git a/settings/js/users/groups.js b/settings/js/users/groups.js
index 3234d6911e4..3ac8d3f36e3 100644
--- a/settings/js/users/groups.js
+++ b/settings/js/users/groups.js
@@ -64,7 +64,23 @@ $(document).ready( function () {
// Call function for handling delete/undo on Groups
GroupList.delete_group(gid);
});
- $('#newgroup').submit(function (event) {
+
+ // Display or hide of Create Group List Element
+ $('#newgroup-form').hide();
+ $('#newgroup-init').on('click', function (e) {
+ e.stopPropagation();
+ $('#newgroup-form').show();
+ $('#newgroup-init').hide();
+ $(document).click( function (e) {
+ if (e.target.id !== 'newgroup-form') {
+ $("#newgroup-form").hide();
+ $("#newgroup-init").show();
+ }
+ });
+ });
+
+ // Responsible for Creating Groups.
+ $('#newgroup-form form').submit(function (event) {
event.preventDefault();
var groupname = $('#newgroupname').val();
if ($.trim(groupname) === '') {
diff --git a/settings/templates/users/part.grouplist.php b/settings/templates/users/part.grouplist.php
index 51351733d0d..620049eb298 100644
--- a/settings/templates/users/part.grouplist.php
+++ b/settings/templates/users/part.grouplist.php
@@ -1,7 +1,12 @@
<ul>
<!-- Add new group -->
- <li>
- <form id="newgroup">
+ <li id="newgroup-init">
+ <a href="#">
+ <span><?php p($l->t('Add Group'))?></span>
+ </a>
+ </li>
+ <li id="newgroup-form">
+ <form>
<input type="text" id="newgroupname" placeholder="<?php p($l->t('Group')); ?>..." />
<input type="submit" class="button" value="<?php p($l->t('Add Group'))?>" />
</form>