]> source.dussan.org Git - nextcloud-server.git/commitdiff
after editing a user quota, set the value of the quota field to how the server parsed...
authorRobin Appelman <icewind1991@gmail.com>
Sun, 11 Dec 2011 22:23:59 +0000 (23:23 +0100)
committerRobin Appelman <icewind1991@gmail.com>
Sun, 11 Dec 2011 22:34:13 +0000 (23:34 +0100)
this way the user can see when an invalid input is given

settings/ajax/setquota.php
settings/js/users.js

index edbf5b74516d4f4010746f561e7bab2b348dc3ba..5c07285cfcac524f2a94a604094d63f150bd8f39 100644 (file)
@@ -10,6 +10,6 @@ $quota= OC_Helper::computerFileSize($_POST["quota"]);
 
 // Return Success story
 OC_Preferences::setValue($username,'files','quota',$quota);
-OC_JSON::success(array("data" => array( "username" => $username ,'quota'=>$quota)));
+OC_JSON::success(array("data" => array( "username" => $username ,'quota'=>OC_Helper::humanFileSize($quota))));
 
 ?>
index 684fee21c64eb14fc587cef22633fe119c19fa92..18e7a9df1042c71c607759cf47ee5518474798a1 100644 (file)
@@ -101,8 +101,11 @@ $(document).ready(function(){
                                if($(this).val().length>0){
                                        $.post(
                                                OC.filePath('settings','ajax','setquota.php'),
-                                                  {username:uid,quota:$(this).val()},
-                                                  function(result){}
+                                               {username:uid,quota:$(this).val()},
+                                               function(result){
+                                                       img.parent().children('span').text(result.data.quota)
+                                                       alert(result.data.quota);
+                                               }
                                        );
                                        input.blur();
                                }else{