Browse Source

Allow triggering version info with keyboard

Danilo Bargen 7 năm trước cách đây
mục cha
commit
23eb1e9860
2 tập tin đã thay đổi với 8 bổ sung6 xóa
  1. 2 5
      index.html
  2. 6 1
      src/controllers/footer.ts

+ 2 - 5
index.html

@@ -91,11 +91,8 @@
         </div>
         <footer ng-controller="FooterController as ctrl">
             <ul>
-                <li><a ng-click="ctrl.showVersionInfo('[[VERSION]]')">Version [[VERSION]] {{ ctrl.config.VERSION_MOUNTAIN }}</a></li>
-                <li><a
-                        href="https://threema.ch/threema-web"
-                        target="_blank"
-                        rel="noopener noreferrer" translate>welcome.MORE_ABOUT_WEB</a>
+                <li><a ng-click="ctrl.showVersionInfo('[[VERSION]]')" ng-keypress="ctrl.showVersionInfo('[[VERSION]]', $event)" tabindex="0">Version [[VERSION]] {{ ctrl.config.VERSION_MOUNTAIN }}</a></li>
+                <li><a href="https://threema.ch/threema-web" target="_blank" rel="noopener noreferrer" tabindex="0" translate>welcome.MORE_ABOUT_WEB</a>
                 </li>
             </ul>
         </footer>

+ 6 - 1
src/controllers/footer.ts

@@ -15,6 +15,8 @@
  * along with Threema Web. If not, see <http://www.gnu.org/licenses/>.
  */
 
+import {isActionTrigger} from '../helpers';
+
 /**
  * Handle footer information.
  */
@@ -29,7 +31,10 @@ export class FooterController {
         this.config = CONFIG;
     }
 
-    public showVersionInfo(version: string): void {
+    public showVersionInfo(version: string, ev?: KeyboardEvent): void {
+        if (ev !== undefined && !isActionTrigger(ev)) {
+            return;
+        }
         this.$mdDialog.show({
             controller: [
                 '$mdDialog',