[#53,view/query][s]: add free text query input to query editor (though backend does not yet use it).

This commit is contained in:
Rufus Pollock 2012-02-24 10:08:19 +00:00
parent 0a17c428cd
commit a470e66ff3
2 changed files with 14 additions and 2 deletions

View File

@ -27,7 +27,17 @@
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;
}

View File

@ -182,6 +182,7 @@ my.QueryEditor = Backbone.View.extend({
className: 'recline-query-editor',
template: ' \
<form action="" method="GET"> \
<input type="text" name="q" value="{{q}}" class="text-query" /> \
<div class="pagination"> \
<ul> \
<li class="prev action-pagination-update"><a>&laquo; back</a></li> \
@ -208,7 +209,8 @@ my.QueryEditor = Backbone.View.extend({
e.preventDefault();
var newOffset = parseInt(this.el.find('input[name="offset"]').val());
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) {
e.preventDefault();