Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Lower case search fix

  • Loading branch information...
commit 7036c03abfc0f3ef970ef18a2c0f5e0d63e4d98f 1 parent 1074361
Russell Middleton authored

Showing 1 changed file with 7 additions and 7 deletions. Show diff stats Hide diff stats

  1. +7 7 photolog.js
14 photolog.js
@@ -89,7 +89,7 @@ var setupSearch = function() {
89 89 var searchString = '#' + this.value.replace('#', '');
90 90 var results = false;
91 91 $(".photoStream").each(function(){
92   - if($(this).text().indexOf(searchString) == 0) {
  92 + if($(this).text().toLowerCase().indexOf(searchString.toLowerCase()) == 0) {
93 93 $(this).parent().show();
94 94 results = true;
95 95 } else {
@@ -337,9 +337,9 @@ photolog.photos.on('add', function (model) {
337 337 loading();
338 338 var pageNum = Math.floor(index / config.pageSize) + 1;
339 339 if (index == 0) {
340   - $('#header').after(photo.render(pageNum).el);
  340 + $('#header').after(photo.render(pageNum, false).el);
341 341 } else {
342   - $(photolog.photos.at(index-1).get('el')).after(photo.render(pageNum).el);
  342 + $(photolog.photos.at(index-1).get('el')).after(photo.render(pageNum, false).el);
343 343 }
344 344 });
345 345
@@ -477,7 +477,7 @@ photolog.views.Upload = Backbone.View.extend({
477 477 var photo = new photolog.views.Photo({
478 478 model: new photolog.models.Photo({url: url})
479 479 });
480   - $('.photo', self.el).after(photo.render().el);
  480 + $('.photo', self.el).after(photo.render(null, true).el);
481 481 $(photo.el).addClass("toUpload");
482 482 });
483 483 self.selImage = file;
@@ -489,7 +489,7 @@ photolog.views.Photo = Backbone.View.extend({
489 489 tagName: "div",
490 490 className: "photo",
491 491
492   - render: function(pageNum) {
  492 + render: function(pageNum, isUpload) {
493 493 var el = this.el;
494 494 this.model.set('el', el);
495 495 $(el).hide();
@@ -509,10 +509,10 @@ photolog.views.Photo = Backbone.View.extend({
509 509 var target = 220;
510 510 var ratio = target/square;
511 511 $(el).html('<div style="display: inline-block; height: '+square*ratio+'px; width: '+square*ratio+'px; overflow: hidden"><a href="#photo/'+state.stream+'/' +photoId+'"><img style="width: '+preloadImage.width*ratio+'px; height: '+preloadImage.height*ratio+'px; margin-left: -'+widthOffset*ratio+'px; margin-top: -'+heightOffset*ratio+'px" src="'+preloadImage.src+'"></a></div>');
512   - if (pageNum == 1) {
  512 + if (pageNum == 1 || isUpload) {
513 513 $(el).fadeIn('slow');
514 514 }
515   - $(el).addClass('loadedPhoto photoPage' + pageNum)
  515 + $(el).addClass('loadedPhoto photoPage' + pageNum);
516 516 loaded();
517 517 }
518 518 preloadImage.src = this.model.get('url');

0 comments on commit 7036c03

Please sign in to comment.
Something went wrong with that request. Please try again.