You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@climate.apache.org by hu...@apache.org on 2018/01/16 04:59:23 UTC
[1/2] climate git commit: CLIMATE-940 File List Does Not Display On
File Selection Due To Property Of Undefined Error
Repository: climate
Updated Branches:
refs/heads/master 85a4e348d -> 92b0aa3d1
CLIMATE-940 File List Does Not Display On File Selection Due To Property Of Undefined Error
Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/e8a2bdc0
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/e8a2bdc0
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/e8a2bdc0
Branch: refs/heads/master
Commit: e8a2bdc04153597d490b19a4ccdca47b2dccfabd
Parents: 4cf79f3
Author: Michael Anderson <mi...@Michaels-iMac.local>
Authored: Wed Jan 3 20:32:11 2018 -0500
Committer: Michael Anderson <mi...@Michaels-iMac.local>
Committed: Wed Jan 3 20:32:11 2018 -0500
----------------------------------------------------------------------
.../directives/predictivefilebrowserinput.js | 25 +++++++++++++-------
1 file changed, 16 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/climate/blob/e8a2bdc0/ocw-ui/frontend/app/scripts/directives/predictivefilebrowserinput.js
----------------------------------------------------------------------
diff --git a/ocw-ui/frontend/app/scripts/directives/predictivefilebrowserinput.js b/ocw-ui/frontend/app/scripts/directives/predictivefilebrowserinput.js
index 7142c15..6fe2118 100644
--- a/ocw-ui/frontend/app/scripts/directives/predictivefilebrowserinput.js
+++ b/ocw-ui/frontend/app/scripts/directives/predictivefilebrowserinput.js
@@ -29,9 +29,16 @@ angular.module('ocwUiApp')
.directive('predictiveFileBrowserInput', function() {
var link = function($scope, $elem, $attrs) {
$scope.autocomplete = [];
-
+
// Set id to use this directive correctly in multiple places
- $scope.id = 'autoCompletePath'+ $elem.context.id
+ /*
+ This had been written as $elem.context.id, but $elem is an object (jQuery.fn.init)
+ and the object did not have a context or id attribute. This was
+ throwing an error to the console and the list of files was not being displayed.
+ Replaced with $attrs.id.
+ */
+ $scope.id = 'autoCompletePath' + $attrs.id;
+
/*
* We need a place to dump our auto-completion options
*/
@@ -43,8 +50,8 @@ angular.module('ocwUiApp')
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');
-
+ $elem.trigger('input');
+
// If the user selected a directory, find more results..
if (val[val.length - 1] == '/') {
$scope.fetchFiles($($elem).val());
@@ -152,7 +159,7 @@ angular.module('ocwUiApp')
$scope.possibleCompletes = $scope.autocomplete;
};
- /*
+ /*
* Handle <TAB> presses.
*
* Attempt to auto-complete options when the user presses <TAB>.
@@ -220,7 +227,7 @@ angular.module('ocwUiApp')
}
};
- /*
+ /*
* Handle all other key presses in the input box
*
* Filter the auto-complete options as the user types to ensure that only options
@@ -236,7 +243,7 @@ angular.module('ocwUiApp')
$scope.updateAutoComplete();
};
- /*
+ /*
* When a path is auto-completed with <TAB> we need to check to see if it points
* to a directory. If it does, we still need to fetch results!
*/
@@ -247,7 +254,7 @@ angular.module('ocwUiApp')
}
};
- /*
+ /*
* Calculate the greatest common prefix of the passed options.
*
* Params:
@@ -275,7 +282,7 @@ angular.module('ocwUiApp')
return longestString.slice(0, index - 1);
};
- /*
+ /*
* Filter the auto-complete options based on the current input.
*/
$scope.filterResults = function() {
[2/2] climate git commit: Merge branch 'CLIMATE-940'
Posted by hu...@apache.org.
Merge branch 'CLIMATE-940'
Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/92b0aa3d
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/92b0aa3d
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/92b0aa3d
Branch: refs/heads/master
Commit: 92b0aa3d1185acb479966ab60cbb302fe656c874
Parents: 85a4e34 e8a2bdc
Author: huikyole <hu...@argo.jpl.nasa.gov>
Authored: Mon Jan 15 20:59:08 2018 -0800
Committer: huikyole <hu...@argo.jpl.nasa.gov>
Committed: Mon Jan 15 20:59:08 2018 -0800
----------------------------------------------------------------------
.../directives/predictivefilebrowserinput.js | 25 +++++++++++++-------
1 file changed, 16 insertions(+), 9 deletions(-)
----------------------------------------------------------------------