Permalink
Browse files

Added loading spinner back to Grid view when a thumbnail is clicked.

  • Loading branch information...
1 parent b79bf22 commit 89b10367137e2e82e28903ba305e2223814cc352 @ericf ericf committed Oct 24, 2011
Showing with 9 additions and 0 deletions.
  1. +9 −0 public/js/views/grid.js
View
@@ -5,6 +5,10 @@ Y.GridView = Y.Base.create('gridView', Y.View, [], {
template : Handlebars.compile(Y.one('#grid-template').getContent()),
photoTemplate: Handlebars.compile(Y.one('#grid-photo-template').getContent()),
+ events: {
+ '.photo': {click: 'select'}
+ },
+
initializer: function (config) {
var photos = this.get('modelList');
@@ -79,6 +83,11 @@ Y.GridView = Y.Base.create('gridView', Y.View, [], {
}
},
+ select: function (e) {
+ this.get('container').all('.photo.selected').removeClass('selected');
+ e.currentTarget.addClass('selected');
+ },
+
reset: function () {
this._maxKnownHeight = 0;
this.get('container').all('.photo.selected').removeClass('selected');

0 comments on commit 89b1036

Please sign in to comment.