Skip to content

Commit

Permalink
fixed image display
Browse files Browse the repository at this point in the history
  • Loading branch information
Orbiter committed Jul 24, 2015
1 parent e26c4a5 commit 1c71369
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions js/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var SearchModel = Backbone.Model.extend({
defaults:{hl:'false',query:'',start:'0',rows:'100',layout:'paragraph',startTime:new Date(),servlet:"index.html",contentdom:"text"},

url:function(){
return searchURL + '&hl=' + this.attributes.hl + '&query=' + this.attributes.query + '&startRecord=' + this.attributes.start + '&maximumRecords=' + this.attributes.rows + '&contentdom=' + this.attributes.contentdom;
return searchURL + '&hl=' + this.attributes.hl + '&query=' + this.attributes.query + '&startRecord=' + this.attributes.start + '&maximumRecords=' + this.attributes.rows + '&contentdom=' + (this.attributes.layout == "images" ? "image" : this.attributes.contentdom);
},

parse:function(resp){
Expand Down Expand Up @@ -87,6 +87,7 @@ var RowModel = Backbone.Model.extend({
var link = this.attributes.link;
if (link == null || link == "") link = this.attributes.image;
if (link == null) return "";
var image = this.attributes.image;
var protocol = "";
var host = "";
// extract the path
Expand Down Expand Up @@ -155,7 +156,7 @@ var RowModel = Backbone.Model.extend({
if (style == "imageCell") {
if (file.length == 0 || file == "/") file = "[image]";
html += "<a href=\"" + link + "\" name=\"" + file + "\">";
html += "<img src=\"" + link + "\" width=\"96\" height=\"96\" />";
html += "<img src=\"" + image + "\" width=\"96\" height=\"96\" />";
html += "</a>";
}

Expand Down

0 comments on commit 1c71369

Please sign in to comment.