Skip to content
Snippets Groups Projects
Unverified Commit 0214d7bf authored by Sébastien Thuret's avatar Sébastien Thuret
Browse files

add buttons

parent cb86d289
No related branches found
No related tags found
No related merge requests found
...@@ -96,7 +96,7 @@ h3.header { ...@@ -96,7 +96,7 @@ h3.header {
} }
.btn-delete-text:focus, .btn-delete-text:focus,
.btn-copy-translated:focus { .btn-action:focus {
background: none !important; background: none !important;
} }
...@@ -107,26 +107,28 @@ h3.header { ...@@ -107,26 +107,28 @@ h3.header {
color: #777; color: #777;
pointer-events: none; pointer-events: none;
} }
.actions {
.btn-copy-translated {
position: absolute; position: absolute;
right: 2.75rem; right: 1.25rem;
bottom: 1rem; bottom: 1rem;
display: flex; display: flex;
}
.btn-action {
display: flex;
align-items: center; align-items: center;
color: #777; color: #777;
font-size: 0.85rem; font-size: 0.85rem;
background: none; background: none;
border: none; border: none;
cursor: pointer; cursor: pointer;
margin-right: -1.5rem;
} }
.btn-copy-translated span { .btn-action span {
padding-right: 0.5rem; padding-right: 0.5rem;
} }
.btn-copy-translated .material-icons { .btn-action .material-icons {
font-size: 1.35rem; font-size: 1.35rem;
} }
......
...@@ -149,9 +149,18 @@ ...@@ -149,9 +149,18 @@
Translated text Translated text
</label> </label>
<textarea id="textarea2" v-model="translatedText" ref="translatedTextarea" dir="auto" readonly></textarea> <textarea id="textarea2" v-model="translatedText" ref="translatedTextarea" dir="auto" readonly></textarea>
<button class="btn-copy-translated" @click="copyText"> <div class="actions">
<span>[[ copyTextLabel ]]</span> <i class="material-icons">content_copy</i> <button v-if="inputText.length && !isSuggesting" class="btn-action" @click="suggestTranslation">
</button> <i class="material-icons">edit</i>
</button>
<button v-if="inputText.length && isSuggesting" class="btn-action" @click="closeSuggestTranslation">
<i class="material-icons">close</i>
</button>
<button class="btn-action btn-copy-translated" @click="copyText">
<span>[[ copyTextLabel ]]</span> <i class="material-icons">content_copy</i>
</button>
</div>
<div class="position-relative"> <div class="position-relative">
<div class="progress translate" v-if="loadingTranslation"> <div class="progress translate" v-if="loadingTranslation">
<div class="indeterminate"></div> <div class="indeterminate"></div>
...@@ -265,7 +274,9 @@ ...@@ -265,7 +274,9 @@
output: "", output: "",
charactersLimit: -1, charactersLimit: -1,
copyTextLabel: "Copy text" copyTextLabel: "Copy text",
isSuggesting: false,
}, },
mounted: function(){ mounted: function(){
var self = this; var self = this;
...@@ -474,6 +485,16 @@ ...@@ -474,6 +485,16 @@
}, 1500); }, 1500);
} }
}, },
suggestTranslation: function(e) {
e.preventDefault();
this.isSuggesting = true;
},
closeSuggestTranslation: function(e) {
e.preventDefault();
this.isSuggesting = false;
},
deleteText: function(e){ deleteText: function(e){
e.preventDefault(); e.preventDefault();
this.inputText = this.translatedText = this.output = ""; this.inputText = this.translatedText = this.output = "";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment