Skip to content

Commit

Permalink
Merge branches 'pr-add-new-keys-first', 'pr-autofocus-key-input', 'pr…
Browse files Browse the repository at this point in the history
…-clear-filter' and 'pr-remember-last-changed-multiline' into pr-quality-of-life-fixes
  • Loading branch information
flommy committed Oct 16, 2020
4 parents 43481df + a79e7e7 + 48f86d2 + 6ba66a5 commit 0a6f3d7
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions views/project.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
<div class="uk-width-1-4">
<div class="uk-form-icon uk-form uk-text-muted uk-display-block">
<i class="uk-icon-filter"></i>
<a class="uk-icon-filter" style="pointer-events: all" onclick="{ clearfilter }"></a>
<input class="uk-form-large uk-form-blank" type="text" ref="txtfilter" placeholder="@lang('Filter...')" onkeyup="{ updatefilter }">
<div class="uk-form-select filter-selector">
Expand Down Expand Up @@ -231,7 +231,7 @@
<div class="uk-form-row">
<label class="uk-text-small">@lang('Key')</label>
<input class="uk-width-1-1" type="text" placeholder="@lang('Key name')" bind-event="input" bind="$key.name" required>
<input ref="keyfield" class="uk-width-1-1" type="text" placeholder="@lang('Key name')" bind-event="input" bind="$key.name" required>
</div>
<div class="uk-form-row">
Expand All @@ -240,7 +240,7 @@
</div>
<div class="uk-form-row">
<field-boolean bind="$key.multiline" label="@lang('Multiline')"></field-boolean>
<field-boolean bind="$key.multiline" label="@lang('Multiline')" onchange="{ changeMultiline }"></field-boolean>
</div>
Expand Down Expand Up @@ -453,11 +453,12 @@
this.$key = {
name: '',
info: '',
multiline: false
multiline: App.session.get('lokalize.new.multiline', false)
};
setTimeout(function() {
UIkit.modal($this.refs.modalkey).show();
$this.refs.keyfield.focus();
}, 100);
}
Expand Down Expand Up @@ -549,6 +550,10 @@
this.$key = null;
}
changeMultiline(e) {
App.session.set('lokalize.new.multiline', e.target.checked);
}
suggestTranslation(e) {
if (suggestionIdle) {
Expand Down Expand Up @@ -597,8 +602,16 @@
}, 250);
}
clearfilter() {
this.refs.txtfilter.value = "";
}
updatefilter(e) {
$this.visible = 20;
if (e.key === "Escape") {
this.clearfilter();
} else {
$this.visible = 20;
}
}
infilter(key) {
Expand Down

0 comments on commit 0a6f3d7

Please sign in to comment.