archive/src/js/image_expander.js
// Generated by CoffeeScript 1.3.3
(function() {
'use strict';
define(function(require) {
var $, exports, gVars, makeItHappen, moduleName;
$ = require('jquery');
exports = {};
gVars = {};
moduleName = 'image_expander';
makeItHappen = function($this) {
var $img;
$img = $this.find('img');
$img.on('click', function() {
if ($this.hasClass('selected')) {
$this.removeClass('selected');
}
else {
$this.addClass('selected');
}
});
};
exports.init = function($this) {
var element;
if ($this !== void 0) {
return makeItHappen($this);
}
else {
element = $('[data-module="' + moduleName + '"]');
return element.each(function() {
return makeItHappen($(this));
});
}
};
return exports;
});
}).call(this);