You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@climate.apache.org by jo...@apache.org on 2013/08/01 23:11:40 UTC
svn commit: r1509432 -
/incubator/climate/trunk/rcmet/src/main/ui/app/js/directives/PredictiveFileBrowserInput.js
Author: joyce
Date: Thu Aug 1 21:11:39 2013
New Revision: 1509432
URL: http://svn.apache.org/r1509432
Log:
CLIMATE-240 - PredictiveFileBrowserInput doesn't properly update model
- Add call to trigger the input box's "input" event when the user
selects an autocomplete option from the drop down menu. This forces
Angular to update the model so two-way data bindings work properly
again.
Modified:
incubator/climate/trunk/rcmet/src/main/ui/app/js/directives/PredictiveFileBrowserInput.js
Modified: incubator/climate/trunk/rcmet/src/main/ui/app/js/directives/PredictiveFileBrowserInput.js
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/rcmet/src/main/ui/app/js/directives/PredictiveFileBrowserInput.js?rev=1509432&r1=1509431&r2=1509432&view=diff
==============================================================================
--- incubator/climate/trunk/rcmet/src/main/ui/app/js/directives/PredictiveFileBrowserInput.js (original)
+++ incubator/climate/trunk/rcmet/src/main/ui/app/js/directives/PredictiveFileBrowserInput.js Thu Aug 1 21:11:39 2013
@@ -34,7 +34,9 @@ App.Directives.directive('predictiveFile
// Set the input text box's value to that of the user selected path
var val = $(e.target).text();
$($elem).val(val);
-
+ // Need to trigger the input box's "input" event so Angular updates the model!
+ $elem.trigger('input');
+
// If the user selected a directory, find more results..
if (val[val.length - 1] == '/') {
$scope.fetchFiles($($elem).val());