Merge pull request #14 from discourse/back_to_query_list

FEATURE: Added a button to go back to query list after visiting a query
This commit is contained in:
Sam 2018-08-17 09:23:40 +10:00 committed by GitHub
commit a1dc982561
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 0 deletions

View File

@ -92,6 +92,12 @@ export default Ember.Controller.extend({
scrollTop() {
window.scrollTo(0,0);
this.set('editing', false);
this.set('everEditing', false);
},
goBack() {
history.back();
},
resetParams() {

View File

@ -33,6 +33,9 @@
{{#if selectedItem}}
{{#if editing}}
<div class="name">
<div class="previous">
{{d-button action="goBack" icon="chevron-left" class="no-text btn-med"}}
</div>
{{text-field value=selectedItem.name}}
</div>
<div class="desc">
@ -40,6 +43,9 @@
</div>
{{else}}
<div class="name">
<div class="previous">
{{d-button action="goBack" icon="chevron-left" class="no-text btn-med"}}
</div>
<h2>{{selectedItem.name}}</h2>
{{d-button action="editName" icon="pencil" class="no-text btn-small"}}
</div>

View File

@ -142,6 +142,12 @@
.name h2 {
display: inline-block;
}
.name .previous {
padding: 0.2em;
display: inline-block;
padding-right: 0.25em;
font-size: 1.2em;
}
.name input, .desc textarea {
width: calc(100% - 10px);
}