basic version of search implemented

This commit is contained in:
Edin Dazdarevic
2015-03-22 16:16:52 +01:00
parent 38548e3e33
commit 9154d216a2
11 changed files with 305 additions and 11 deletions

View File

@@ -0,0 +1,24 @@
var Backbone = require('backbone'),
Item = require('./item'),
Globals = require('../globals');
var ItemSearchCollection = Backbone.Collection.extend({
initialize: function() {
$.ajaxPrefilter(
function(options, originalOptions, jqXHR) {
options.xhrFields = {
withCredentials: true
}
}
);
},
setQuery: function(q) {
this.q = q;
},
model: Item,
url: function() {
return Globals.ApiUrl + "/search?q=" + this.q;
}
});
module.exports = ItemSearchCollection;