Use navigator platform to display separate for Linux OS - 4848 (#5115)

* Regex match the linux platform and display separate message

* Added test for different alt test based on OS in userAgent

* Simplify to use full navigator string instead of navigator.platform or userAgentData.platform

* Use userAgent string

* Test.skip depending on OS

* Remove .only after confirming test

* Adjust the skip logic

* Fix Flake

* halfbaked implementation

* Updated test to use os specific hotkeys and check for correct text

* Remove test.only

* Delete old tests

Co-authored-by: Shefali Joshi <simplyrender@gmail.com>
Co-authored-by: unlikelyzero <jchill2@gmail.com>
This commit is contained in:
Michael Rogers
2022-05-03 12:18:06 -05:00
committed by GitHub
parent 20d7e80502
commit b77a4066f2
2 changed files with 67 additions and 38 deletions

View File

@ -55,7 +55,7 @@
<div
v-if="zoomFactor > 1"
class="c-imagery__hints"
>Alt-drag to pan</div>
>{{formatImageAltText}}</div>
<div
ref="focusedImageWrapper"
class="image-wrapper"
@ -478,6 +478,16 @@ export default {
width: this.sizedImageWidth,
height: this.sizedImageHeight
};
},
formatImageAltText() {
const regexLinux = /Linux/;
const navigator = window.navigator.userAgent;
if (regexLinux.test(navigator)) {
return 'Ctrl+Alt drag to pan';
}
return 'Alt drag to pan';
}
},
watch: {