From 1abc264873cf9eb4312f5a9554ae2782955dd07c Mon Sep 17 00:00:00 2001
From: Robin Appelman <icewind@owncloud.com>
Date: Wed, 10 Apr 2013 14:12:54 +0200
Subject: [PATCH] Add the quota change listeners to newly added user entries in
 the user list

---
 settings/js/users.js | 31 +++++++++++++++++++------------
 1 file changed, 19 insertions(+), 12 deletions(-)

diff --git a/settings/js/users.js b/settings/js/users.js
index b92feb5233..4a358a4392 100644
--- a/settings/js/users.js
+++ b/settings/js/users.js
@@ -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));
 	});
-- 
GitLab