This repository has been archived by the owner on Jun 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 243
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify some code and extract some methods to a helpers file
- Loading branch information
1 parent
02173ee
commit 7c64ff4
Showing
4 changed files
with
38 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
<template> | ||
<button class="wizard-btn btn-fill wizard-btn-wd" tabindex="-1"> | ||
<button class="wizard-btn" tabindex="-1"> | ||
<slot></slot> | ||
</button> | ||
</template> | ||
<script> | ||
export default {} | ||
export default {} | ||
</script> | ||
<style> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
export function getFocusedElementId () { | ||
return document.activeElement.id | ||
} | ||
export function getFocusedTabIndex (tabs = []) { | ||
let activeId = getFocusedElementId() | ||
let tabIndex = tabs.findIndex(tab => tab.tabId === activeId) | ||
return tabIndex | ||
} | ||
export function findElementAndFocus (elemId) { | ||
let elem = document.getElementById(elemId) | ||
elem.focus() | ||
} | ||
export function isPromise (func) { | ||
return func.then && typeof func.then === 'function' | ||
} |