Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

  • Loading branch information...
commit 89b10367137e2e82e28903ba305e2223814cc352 1 parent b79bf22
@ericf ericf authored
Showing with 9 additions and 0 deletions.
  1. +9 −0 public/js/views/grid.js
View
9 public/js/views/grid.js
@@ -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');
Please sign in to comment.
Something went wrong with that request. Please try again.