]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add the quota change listeners to newly added user entries in the user list
authorRobin Appelman <icewind@owncloud.com>
Wed, 10 Apr 2013 12:12:54 +0000 (14:12 +0200)
committerRobin Appelman <icewind@owncloud.com>
Wed, 10 Apr 2013 12:50:42 +0000 (14:50 +0200)
settings/js/users.js

index d79b21765ff910b33b62da200f742ac072a831f5..5f9710053c93da5abdec0fd3cadc7c262e9bd9a0 100644 (file)
@@ -4,6 +4,18 @@
  * See the COPYING-README file.
  */
 
+function setQuota (uid, quota, ready) {
+       $.post(
+               OC.filePath('settings', 'ajax', 'setquota.php'),
+               {username: uid, quota: quota},
+               function (result) {
+                       if (ready) {
+                               ready(result.data.quota);
+                       }
+               }
+       );
+}
+
 var UserList = {
        useUndo: true,
        availableGroups: [],
@@ -118,6 +130,13 @@ var UserList = {
                if (sort) {
                        UserList.doSort();
                }
+
+               quotaSelect.singleSelect();
+               quotaSelect.on('change', function () {
+                       var uid = $(this).parent().parent().attr('data-uid');
+                       var quota = $(this).val();
+                       setQuota(uid, quota);
+               });
        },
        // From http://my.opera.com/GreyWyvern/blog/show.dml/1671288
        alphanum: function(a, b) {
@@ -303,18 +322,6 @@ $(document).ready(function () {
                });
        });
 
-       function setQuota (uid, quota, ready) {
-               $.post(
-                       OC.filePath('settings', 'ajax', 'setquota.php'),
-                       {username: uid, quota: quota},
-                       function (result) {
-                               if (ready) {
-                                       ready(result.data.quota);
-                               }
-                       }
-               );
-       }
-
        $('select[multiple]').each(function (index, element) {
                UserList.applyMultiplySelect($(element));
        });