OSDN Git Service

add paginator
[pettanr/pettanr.git] / app / assets / javascripts / models / balloon.js.coffee
1 class Pettanr.Balloon extends Peta.Element\r
2   @singular: () ->\r
3     'Balloon'\r
4   \r
5   @plural: () ->\r
6     'Balloons'\r
7   \r
8   defaults: {\r
9     id: null,\r
10     x: 0,\r
11     y: 0,\r
12     width: 100,\r
13     height: 100,\r
14     r: 0\r
15   } \r
16   \r
17   url: () ->\r
18     '/system_pictures/' + @system_picture().filename()\r
19   \r
20   symbol_option: () ->\r
21     @speech_balloon().speech_balloon_template().symbol_option()\r
22   \r
23   style: () ->\r
24     {\r
25       width: Pettanr.to_s(@get('width')) + 'px', \r
26       height: Pettanr.to_s(@get('height')) + 'px',\r
27       top: Pettanr.to_s(@get('y')) + 'px',\r
28       left: Pettanr.to_s(@get('x')) + 'px'\r
29     }\r
30   \r
31   initialize: () ->\r
32     if @id\r
33       @url = @url + @id\r
34   \r
35 class Pettanr.Balloon.Collection extends Backbone.Collection\r
36   model: Pettanr.Balloon\r
37   url: '/balloons'\r
38 \r