fix code style

This commit is contained in:
Rodrigo Quelca
2021-08-20 03:50:06 +00:00
parent 62377e146f
commit 18f39b8db9
3 changed files with 20 additions and 33 deletions

View File

@@ -140,7 +140,7 @@
<template #modal-footer="{ cancel }"> <template #modal-footer="{ cancel }">
<b-button size="sm" variant="danger" @click="cancel()"> <b-button size="sm" variant="danger" @click="cancel()">
{{ $t("ID_CLOSE")}} {{ $t("ID_CLOSE") }}
</b-button> </b-button>
</template> </template>
</b-modal> </b-modal>

View File

@@ -5,10 +5,7 @@
:title="labelTooltip" :title="labelTooltip"
> >
{{ data.title }} {{ data.title }}
<b-tooltip <b-tooltip :target="`label-${data.id}`" :ref="`tooltip-${data.id}`">
:target="`label-${data.id}`"
:ref="`tooltip-${data.id}`"
>
{{ labelTooltip }} {{ labelTooltip }}
</b-tooltip> </b-tooltip>
</span> </span>
@@ -25,9 +22,6 @@ export default {
data() { data() {
return { return {
labelTooltip: "", labelTooltip: "",
hovering: "",
show: false,
disabled: true,
menuMap: { menuMap: {
CASES_INBOX: "inbox", CASES_INBOX: "inbox",
CASES_DRAFT: "draft", CASES_DRAFT: "draft",
@@ -36,43 +30,36 @@ export default {
todo: "inbox", todo: "inbox",
draft: "draft", draft: "draft",
paused: "paused", paused: "paused",
unassigned: "unassigned" unassigned: "unassigned",
} },
} };
}, },
methods: { methods: {
/** /**
* Delay the hover event * Delay the hover event
*/ */
hoverHandler() { hoverHandler() {
// this.hovering = setTimeout(() => { this.setTooltip() }, 3000);
this.setTooltip(); this.setTooltip();
}, },
/** /**
* Reset the delay and hide the tooltip * Reset the delay and hide the tooltip
*/ */
unhoverHandler() { unhoverHandler() {
let key =`tooltip-${this.data.id}`; let key = `tooltip-${this.data.id}`;
this.labelTooltip = ""; this.labelTooltip = "";
// this.show = false; this.$refs[key].$emit("close");
this.disabled = true;
this.$refs[key].$emit('close');
clearTimeout(this.hovering);
}, },
/** /**
* Set the label to show in the tooltip * Set the label to show in the tooltip
*/ */
setTooltip() { setTooltip() {
let that = this; let that = this;
api.menu api.menu.getTooltip(that.menuMap[that.data.id]).then((response) => {
.getTooltip(that.menuMap[that.data.id]) let key = `tooltip-${that.data.id}`;
.then((response) => {
let key =`tooltip-${that.data.id}`;
that.disabled = false;
that.labelTooltip = response.data.label; that.labelTooltip = response.data.label;
that.$refs[key].$emit('open'); that.$refs[key].$emit("open");
}); });
}, },
} },
} };
</script> </script>

View File

@@ -53,7 +53,7 @@ class UserConfig extends Model
$model = new UserConfig(); $model = new UserConfig();
$model->USR_ID = $id; $model->USR_ID = $id;
$model->USC_NAME = $name; $model->USC_NAME = $name;
$model->USC_SETTING = json_encode($setting, JSON_FORCE_OBJECT); $model->USC_SETTING = json_encode($setting);
$model->save(); $model->save();
$userConfig = UserConfig::getSetting($id, $name); $userConfig = UserConfig::getSetting($id, $name);
return $userConfig; return $userConfig;