This repository was archived by the owner on Sep 19, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +23
-1
lines changed
Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ All notable changes to this project will be documented in this file.
99 - Social IdP has 'Sign in with' before name, Preferred IdP hasn't
1010 - Added possibility to change display name in attribute 'fullDisplayName' in metadata
1111- If user's last selected IdP is known then show only this IdP and button to show all IdPs
12+ - Set autofocus on previously selected IdP if exist
1213
1314#### Fixed
1415- Fixed the bug in 'getEntitylesAttribute' function to return correct value of Entityless attribute
Original file line number Diff line number Diff line change 3030
3131$ this ->data ['head ' ] .= searchScript ();
3232$ this ->data ['head ' ] .= showEntriesScript ();
33+ $ this ->data ['head ' ] .= setFocus ();
3334
3435const CONFIG_FILE_NAME = 'module_perun.php ' ;
3536
122123 if (!$ warningIsOn || $ warningType === WARNING_TYPE_INFO || $ warningType === WARNING_TYPE_WARNING ) {
123124 if (!empty ($ this ->getPreferredIdp ())) {
124125 echo '<p class="descriptionp"> ' . $ this ->t ('{perun:disco:previous_selection} ' ) . '</p> ' ;
125- echo '<div class="metalist list-group"> ' ;
126+ echo '<div id="last-used-idp" class="metalist list-group"> ' ;
126127 echo showEntry ($ this , $ this ->getPreferredIdp (), true );
127128 echo '</div> ' ;
128129
@@ -211,6 +212,21 @@ function searchScript()
211212 return $ script ;
212213}
213214
215+ function setFocus ()
216+ {
217+ $ script = '<script type="text/javascript">
218+
219+ $(document).ready(function() {
220+ if ($("#last-used-idp")) {
221+ $("#last-used-idp .metaentry").focus();
222+ }
223+ });
224+
225+ </script> ' ;
226+
227+ return $ script ;
228+ }
229+
214230/**
215231 * @param DiscoTemplate $t
216232 * @param array $metadata
Original file line number Diff line number Diff line change @@ -6,6 +6,11 @@ a.metaentry:hover {
66 background-image : none;
77}
88
9+ a .metaentry : focus {
10+ outline : none;
11+ background-color : rgba (0 , 0 , 0 , 0.05 );
12+ }
13+
914a .metaentry .favourite {
1015 background-image : url(../ ../ ../ ../ resources/icons/silk/star.png);
1116 background-position : 10px center;
You can’t perform that action at this time.
0 commit comments