From bebdcde93b83d822d0f8a6804bc65a159358bbfe Mon Sep 17 00:00:00 2001 From: Chris Houseknecht Date: Thu, 31 Jul 2014 14:03:30 -0400 Subject: [PATCH] File drag-n-drop Set validity of 'required' to true and field status to dirty upon successful read of file, otherwise the Save button is never enabled. --- awx/ui/static/lib/ansible/directives.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/awx/ui/static/lib/ansible/directives.js b/awx/ui/static/lib/ansible/directives.js index fefa8232b1..41b4868908 100644 --- a/awx/ui/static/lib/ansible/directives.js +++ b/awx/ui/static/lib/ansible/directives.js @@ -782,6 +782,11 @@ angular.module('AWDirectives', ['RestServices', 'Utilities', 'AuthService', 'Job reader.onload = function() { ctrl.$setViewValue(reader.result); ctrl.$render(); + ctrl.$setValidity('required',true); + ctrl.$dirty = true; + if (!scope.$$phase) { + scope.$digest(); + } }; reader.onerror = function() { Alert('Error','There was an error reading the selected file.');