X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=app%2Fassets%2Fjavascripts%2Fmodels%2Fsheet_panel.js.coffee;h=d4c660e3d264820281647becf1fe3d3d2bab2a4f;hb=cc2dbf353c285c78423a8a29d7adf233e1651c6e;hp=4e75dd3d35e3d91eaa7bca93eb54bc5379a82fe3;hpb=70027b80e56b5fbea8d63d520fbbf92050959f28;p=pettanr%2Fpettanr.git diff --git a/app/assets/javascripts/models/sheet_panel.js.coffee b/app/assets/javascripts/models/sheet_panel.js.coffee index 4e75dd3d..d4c660e3 100644 --- a/app/assets/javascripts/models/sheet_panel.js.coffee +++ b/app/assets/javascripts/models/sheet_panel.js.coffee @@ -1,15 +1,30 @@ class Pettanr.SheetPanel extends Peta.Leaf - @single: () -> + url: '/sheet_panels/' + + @singular: () -> 'SheetPanel' @plural: () -> 'SheetPanels' defaults: { - id: 11 + id: null, + x: 15, + y: 15, + sheet_id: null, + panel_id: null, + z: 1, + t: null } - initialize: () -> - confirm("Welcome to Panel") + sheet: () -> + new Pettanr.Cache.Retriever(Pettanr.Sheet, @get('sheet_id')) + + panel: () -> + new Pettanr.Cache.Retriever(Pettanr.Panel, @get('panel_id')) + + initialize: (attr = {}, options = {}) -> + super(attr, options) + if @id + @url = @url + @id -