Skip to content

Commit

Permalink
Refactor top-nav isDirectionalityLtr function
Browse files Browse the repository at this point in the history
  • Loading branch information
kommunarr committed Aug 29, 2023
1 parent 5325cc2 commit a97c183
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/renderer/components/top-nav/top-nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,8 @@ export default defineComponent({
return this.$store.getters.getCurrentLocale
},

isDirectionLtr: function() {
const locale = this.currentLocale
return !(locale === 'ar' || locale === 'fa' || locale === 'he' || locale === 'ur' || locale === 'yi')
isDirectionalityLtr: function() {
return document.body.dir === 'ltr'
},

backendFallback: function () {
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/components/top-nav/top-nav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
:aria-disabled="isArrowBackwardDisabled"
class="navIcon"
:class="{ arrowBackwardDisabled: isArrowBackwardDisabled}"
:icon="['fas', isDirectionLtr ? 'arrow-left' : 'arrow-right']"
:icon="['fas', isDirectionalityLtr ? 'arrow-left' : 'arrow-right']"
role="button"
tabindex="0"
:title="backwardText"
Expand All @@ -28,7 +28,7 @@
:aria-disabled="isArrowForwardDisabled"
class="navIcon"
:class="{ arrowForwardDisabled: isArrowForwardDisabled}"
:icon="['fas', isDirectionLtr ? 'arrow-right' : 'arrow-left']"
:icon="['fas', isDirectionalityLtr ? 'arrow-right' : 'arrow-left']"
role="button"
tabindex="0"
:title="forwardText"
Expand Down

0 comments on commit a97c183

Please sign in to comment.