Skip to content

Commit

Permalink
input templates improve
Browse files Browse the repository at this point in the history
  • Loading branch information
mikhailprivalov committed Dec 1, 2022
1 parent e1fc577 commit 0daffdf
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/actionsVersionsUpdater.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
build:
runs-on: self-hosted
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
stale:
runs-on: self-hosted
runs-on: ubuntu-latest

steps:
- uses: actions/stale@v6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/vue_cli_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
jobs:
webpack_build_prod:

runs-on: self-hosted
runs-on: ubuntu-latest

steps:
- name: Check out source repository
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/webpack_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ concurrency:

jobs:
webpack_build_prod:
runs-on: self-hosted
runs-on: ubuntu-latest

steps:
- name: Check out source repository
Expand Down
34 changes: 31 additions & 3 deletions l2-frontend/src/forms/InputTemplates.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,15 @@
<button
v-tippy
class="btn btn-blue-nb2"
title="Применить шаблон"
title="Добавить значение"
@click="useTemplateAppend(t.value)"
>
<i class="fas fa-plus" />
</button>
<button
v-tippy
class="btn btn-blue-nb2"
title="Заменить значение"
@click="useTemplate(t.value)"
>
<i class="fas fa-check" />
Expand Down Expand Up @@ -194,6 +202,26 @@ export default {
this.open = false;
this.$root.$emit('msg', 'ok', 'Шаблон применён', 2000);
},
useTemplateAppend(v) {
if (!v) {
return;
}
let result = this.field.value.trim();
let vToAppend: string = v;
if (result.length > 0) {
const li = result.length - 1;
if (result[li] === '.') {
vToAppend = vToAppend.charAt(0).toLocaleUpperCase() + vToAppend.slice(1);
}
vToAppend = ` ${vToAppend}`;
}
result += vToAppend;
this.useTemplate(result);
},
},
};
</script>
Expand All @@ -217,8 +245,8 @@ textarea {
.t-group {
.form-control {
width: calc(100% - 80px);
flex: 0 calc(100% - 80px);
width: calc(100% - 120px);
flex: 0 calc(100% - 120px);
}
.input-group-btn {
Expand Down

0 comments on commit 0daffdf

Please sign in to comment.