[#53,view/query][s]: add free text query input to query editor (though backend does not yet use it).
This commit is contained in:
@@ -27,7 +27,17 @@
|
|||||||
float: none;
|
float: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header .recline-query-editor input {
|
.header .recline-query-editor label {
|
||||||
|
float: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header .recline-query-editor input.text-query {
|
||||||
|
float: left;
|
||||||
|
margin-top: 1px;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header .recline-query-editor .pagination input {
|
||||||
width: 30px;
|
width: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -182,6 +182,7 @@ my.QueryEditor = Backbone.View.extend({
|
|||||||
className: 'recline-query-editor',
|
className: 'recline-query-editor',
|
||||||
template: ' \
|
template: ' \
|
||||||
<form action="" method="GET"> \
|
<form action="" method="GET"> \
|
||||||
|
<input type="text" name="q" value="{{q}}" class="text-query" /> \
|
||||||
<div class="pagination"> \
|
<div class="pagination"> \
|
||||||
<ul> \
|
<ul> \
|
||||||
<li class="prev action-pagination-update"><a>« back</a></li> \
|
<li class="prev action-pagination-update"><a>« back</a></li> \
|
||||||
@@ -208,7 +209,8 @@ my.QueryEditor = Backbone.View.extend({
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
var newOffset = parseInt(this.el.find('input[name="offset"]').val());
|
var newOffset = parseInt(this.el.find('input[name="offset"]').val());
|
||||||
var newSize = parseInt(this.el.find('input[name="to"]').val()) - newOffset;
|
var newSize = parseInt(this.el.find('input[name="to"]').val()) - newOffset;
|
||||||
this.model.set({size: newSize, offset: newOffset});
|
var query = this.el.find('.text-query').val();
|
||||||
|
this.model.set({size: newSize, offset: newOffset, q: query});
|
||||||
},
|
},
|
||||||
onPaginationUpdate: function(e) {
|
onPaginationUpdate: function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|||||||
Reference in New Issue
Block a user