This repository was archived by the owner on May 30, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +28
-2
lines changed
appserver/java-spring/static/app/dialogs Expand file tree Collapse file tree 2 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,18 @@ define(['app/module'], function (module) {
3535
3636 ssSession . create ( ) . attachScope ( $scope , 'session' ) ;
3737
38+ // some browsers don't raise events when they autocomplete
39+ var getFromInputByClass = function ( className ) {
40+ var el = angular . element (
41+ document . getElementsByClassName ( className ) . item ( 0 )
42+ ) ;
43+ return el . val ( ) ;
44+ } ;
45+
46+ var credentialsHack = function ( ) {
47+ $scope . session . username = getFromInputByClass ( 'ss-input-username' ) ;
48+ $scope . session . password = getFromInputByClass ( 'ss-input-password' ) ;
49+ } ;
3850
3951 /**
4052 * @ngdoc method
@@ -48,6 +60,7 @@ define(['app/module'], function (module) {
4860 * property.
4961 */
5062 $scope . authenticate = function ( ) {
63+ credentialsHack ( ) ;
5164 mlAuth . authenticate ( $scope . session ) . then (
5265 onAuthSuccess ,
5366 onAuthFailure
@@ -86,7 +99,7 @@ define(['app/module'], function (module) {
8699
87100 $scope . random1 = randomName ( ) ;
88101 $scope . random2 = randomName ( ) ;
89-
102+
90103 }
91104 ] ) ;
92105
Original file line number Diff line number Diff line change @@ -35,6 +35,18 @@ define(['app/module'], function (module) {
3535
3636 ssSession . create ( ) . attachScope ( $scope , 'session' ) ;
3737
38+ // some browsers don't raise events when they autocomplete
39+ var getFromInputByClass = function ( className ) {
40+ var el = angular . element (
41+ document . getElementsByClassName ( className ) . item ( 0 )
42+ ) ;
43+ return el . val ( ) ;
44+ } ;
45+
46+ var credentialsHack = function ( ) {
47+ $scope . session . username = getFromInputByClass ( 'ss-input-username' ) ;
48+ $scope . session . password = getFromInputByClass ( 'ss-input-password' ) ;
49+ } ;
3850
3951 /**
4052 * @ngdoc method
@@ -48,6 +60,7 @@ define(['app/module'], function (module) {
4860 * property.
4961 */
5062 $scope . authenticate = function ( ) {
63+ credentialsHack ( ) ;
5164 mlAuth . authenticate ( $scope . session ) . then (
5265 onAuthSuccess ,
5366 onAuthFailure
@@ -86,7 +99,7 @@ define(['app/module'], function (module) {
8699
87100 $scope . random1 = randomName ( ) ;
88101 $scope . random2 = randomName ( ) ;
89-
102+
90103 }
91104 ] ) ;
92105
You can’t perform that action at this time.
0 commit comments