generated from Seekra/repository-template
style: ensure named functions
This commit is contained in:
@@ -38,7 +38,7 @@ const colorSchemeIconMapper = {
|
|||||||
'auto': 'circle-black-white'
|
'auto': 'circle-black-white'
|
||||||
};
|
};
|
||||||
|
|
||||||
const getTooltipTranslation = function(colorScheme) {
|
const getTooltipTranslation = function getTooltipTranslation(colorScheme) {
|
||||||
return t(`preferences.colorScheme.switch.${colorSchemeNextMapper[colorScheme]}`);
|
return t(`preferences.colorScheme.switch.${colorSchemeNextMapper[colorScheme]}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -36,12 +36,12 @@ const selectLanguage = function selectLanguage(code) {
|
|||||||
|
|
||||||
watch(() => getSetting(LANGUAGE_PATH), setLocale);
|
watch(() => getSetting(LANGUAGE_PATH), setLocale);
|
||||||
|
|
||||||
const close = function() {
|
const close = function close() {
|
||||||
document.removeEventListener('click', closeWrapperOnClickOutside);
|
document.removeEventListener('click', closeWrapperOnClickOutside);
|
||||||
isOpen.value = false;
|
isOpen.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
const closeWrapperOnClickOutside = function(e) {
|
const closeWrapperOnClickOutside = function closeWrapperOnClickOutside(e) {
|
||||||
if (languageDropdown.value) {
|
if (languageDropdown.value) {
|
||||||
if (!languageDropdown.value.contains(e.target)) {
|
if (!languageDropdown.value.contains(e.target)) {
|
||||||
close();
|
close();
|
||||||
@@ -49,7 +49,7 @@ const closeWrapperOnClickOutside = function(e) {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const open = function() {
|
const open = function open() {
|
||||||
if (!isOpen.value) {
|
if (!isOpen.value) {
|
||||||
isOpen.value = true;
|
isOpen.value = true;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ const { t } = useI18n();
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const props = defineProps(['autoSubmit']);
|
const props = defineProps(['autoSubmit']);
|
||||||
|
|
||||||
const submitSearch = function() {
|
const submitSearch = function submitSearch() {
|
||||||
if (props.autoSubmit !== undefined) {
|
if (props.autoSubmit !== undefined) {
|
||||||
router.push({
|
router.push({
|
||||||
name: 'searchResults',
|
name: 'searchResults',
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export const ensureUnit = function(d) {
|
export const ensureUnit = function ensureUnit(d) {
|
||||||
if (!d) d = 0;
|
if (!d) d = 0;
|
||||||
|
|
||||||
// ensure that it is a string
|
// ensure that it is a string
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ const router = useRouter();
|
|||||||
|
|
||||||
const searchQuery = ref('');
|
const searchQuery = ref('');
|
||||||
|
|
||||||
const submitSearch = function() {
|
const submitSearch = function ensureUnit() {
|
||||||
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user