From 87c47c6fcee722b5bd7adb3b63b03afa33e12c1f Mon Sep 17 00:00:00 2001 From: "Tony.Nguyen" Date: Wed, 11 Feb 2015 18:12:46 +0800 Subject: [PATCH] TN: Disable the fields that not supported and refresh owner pet after adding --- .../components/_partials/_modal_add_owner.html | 16 ++++++++-------- .../components/_partials/_modal_add_pet.html | 2 +- src/main/webapp/components/pets/PetController.js | 4 +++- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/main/webapp/components/_partials/_modal_add_owner.html b/src/main/webapp/components/_partials/_modal_add_owner.html index 257a4c560..46bc67e82 100644 --- a/src/main/webapp/components/_partials/_modal_add_owner.html +++ b/src/main/webapp/components/_partials/_modal_add_owner.html @@ -33,17 +33,17 @@
- +
- +
- +
@@ -59,7 +59,7 @@
- +
@@ -142,17 +142,17 @@
- +
- +
- +
@@ -168,7 +168,7 @@
- +
diff --git a/src/main/webapp/components/_partials/_modal_add_pet.html b/src/main/webapp/components/_partials/_modal_add_pet.html index 697182feb..f34def502 100644 --- a/src/main/webapp/components/_partials/_modal_add_pet.html +++ b/src/main/webapp/components/_partials/_modal_add_pet.html @@ -33,7 +33,7 @@
- +
diff --git a/src/main/webapp/components/pets/PetController.js b/src/main/webapp/components/pets/PetController.js index 3f2eff547..768cb69be 100644 --- a/src/main/webapp/components/pets/PetController.js +++ b/src/main/webapp/components/pets/PetController.js @@ -22,6 +22,8 @@ var AddPetController = ['$scope','$rootScope','PetType','OwnerPet',function($sco $scope.currentPet.type.name = $scope.petTypes[i].name; } } - OwnerPet.save({ownerId:currentOwnerId},$scope.currentPet); + OwnerPet.save({ownerId:currentOwnerId},$scope.currentPet, function(pet) { + $scope.currentOwner.pets.push(pet); + }); }; }]; \ No newline at end of file