Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 21 additions & 6 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 @@ -454,11 +454,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 @@ -525,6 +526,8 @@

UIkit.modal($this.refs.modalkey).hide();

this.keys = Object.keys(this.project.keys).sort();

this.project.keys[this.$key.name] = {
info: this.$key.info,
multiline: this.$key.multiline
Expand All @@ -543,11 +546,15 @@
delete this.project.keys[this.$key._];
}

this.keys = Object.keys(this.project.keys).sort();
this.keys.unshift(this.$key.name);

this.$key = null;
}

changeMultiline(e) {
App.session.set('lokalize.new.multiline', e.target.checked);
}

suggestTranslation(e) {

if (suggestionIdle) {
Expand Down Expand Up @@ -596,8 +603,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