Browse Source

DIV-282 - fixed issue "clearing the input value via the date picker does not work"

pull/160/head
Mike Olund 8 years ago
parent
commit
7315dfb5b3
3 changed files with 6 additions and 1 deletions
  1. +1
    -1
      edivorce/apps/core/static/js/controllers.js
  2. +2
    -0
      edivorce/apps/core/static/js/main.js
  3. +3
    -0
      edivorce/apps/core/views/api.py

+ 1
- 1
edivorce/apps/core/static/js/controllers.js View File

@ -88,7 +88,7 @@ var radioWithTextboxControl = function(el){
// when textbox is clicked, update associated radio button response with its value // when textbox is clicked, update associated radio button response with its value
else if (el.is(".other-textbox")){ else if (el.is(".other-textbox")){
var radioTextbox = el.parent().find(".radio_with_textbox");
var radioTextbox = el.parent().parent().find(".radio-with-other");
ajaxCall(radioTextbox.prop('name'), radioTextbox.val()); ajaxCall(radioTextbox.prop('name'), radioTextbox.val());
} }
}; };


+ 2
- 0
edivorce/apps/core/static/js/main.js View File

@ -137,6 +137,8 @@ var date_picker = function (selector, showOnFocus) {
$(this).closest(selector).find('input').attr('readonly','readonly'); $(this).closest(selector).find('input').attr('readonly','readonly');
}).on('hide', function(e) { }).on('hide', function(e) {
$(this).closest(selector).find('input').removeAttr('readonly'); $(this).closest(selector).find('input').removeAttr('readonly');
}).on('clearDate', function(e) {
$(this).closest(selector).find('input').triggerHandler('change');
}); });
}; };


+ 3
- 0
edivorce/apps/core/views/api.py View File

@ -8,6 +8,9 @@ from ..serializer import UserResponseSerializer
class UserResponseHandler(APIView): class UserResponseHandler(APIView):
def post(self, request): def post(self, request):
if request.data == {}:
return Response(status=status.HTTP_204_NO_CONTENT)
serializer = UserResponseSerializer(data=request.data) serializer = UserResponseSerializer(data=request.data)
try: try:


Loading…
Cancel
Save