summaryrefslogtreecommitdiffstats
path: root/settings/js
diff options
context:
space:
mode:
authorraghunayyar <me@iraghu.com>2014-02-18 21:59:45 +0530
committerArthur Schiwon <blizzz@owncloud.com>2014-06-02 12:52:53 +0200
commit970f8997260606d805880192dbb389e8b196371a (patch)
tree1236007a12091d8f10203016b7914d8d00701e82 /settings/js
parentdc28f589517e05ef29c6c06145ab4944c0aa2994 (diff)
downloadnextcloud-server-970f8997260606d805880192dbb389e8b196371a.tar.gz
nextcloud-server-970f8997260606d805880192dbb389e8b196371a.zip
Initial Commit : Changes Storage to Quota, Implements GroupName editing.
Diffstat (limited to 'settings/js')
-rw-r--r--settings/js/users.js33
1 files changed, 33 insertions, 0 deletions
diff --git a/settings/js/users.js b/settings/js/users.js
index 5d4fbed2a2b..f31367472a8 100644
--- a/settings/js/users.js
+++ b/settings/js/users.js
@@ -632,6 +632,39 @@ $(document).ready(function () {
}
});
});
+
+ // Implements Groupname editing.
+ $('#app-navigation').on('click', 'span.utils>img.rename', function (event) {
+ event.stopPropagation();
+ var img = $(this);
+ var gid = img.parent().parent().attr('data-gid');
+ var groupname = escapeHTML(img.parent().parent().attr('data-gid'));
+ var input = $('<input type="text" value="' + groupname + '">');
+ img.css('display', 'none');
+ img.parent().parent().children('a').replaceWith(input);
+ input.focus();
+ input.keypress(function (event) {
+ if (event.keyCode === 13) {
+ if ($(this).val().length > 0) {
+ $.post(
+ OC.filePath('settings', 'ajax', 'changegroupname.php'),
+ { groupname: gid,
+ groupname: $(this).val()
+ }
+ );
+ input.blur();
+ } else {
+ input.blur();
+ }
+ }
+ });
+ input.blur(function () {
+ var input = $(this), groupname = input.val();
+ input.closest('li').attr('data-gid', groupname);
+ input.replaceWith('<a href="#">' + escapeHTML(groupname) + '</a>');
+ img.css('display', '');
+ });
+ });
// Handle undo notifications
OC.Notification.hide();