-
Notifications
You must be signed in to change notification settings - Fork 260
/
Copy pathsample.js
40 lines (39 loc) · 1.15 KB
/
sample.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Generated by CoffeeScript 2.5.1
(function() {
$(function() {
var brick;
brick = "<div class='brick small'><div class='delete'>×</div></div>";
$(document).on("click touchend", ".gridly .brick", function(event) {
var $this, size;
event.preventDefault();
event.stopPropagation();
$this = $(this);
$this.toggleClass('small');
$this.toggleClass('large');
if ($this.hasClass('small')) { // HACK
size = 140;
}
if ($this.hasClass('large')) { // HACK
size = 300;
}
$this.data('width', size);
$this.data('height', size);
return $('.gridly').gridly('layout');
});
$(document).on("click", ".gridly .delete", function(event) {
var $this;
event.preventDefault();
event.stopPropagation();
$this = $(this);
$this.closest('.brick').remove();
return $('.gridly').gridly('layout');
});
$(document).on("click", ".add", function(event) {
event.preventDefault();
event.stopPropagation();
$('.gridly').append(brick);
return $('.gridly').gridly();
});
return $('.gridly').gridly();
});
}).call(this);