X-Git-Url: http://git.osdn.net/view?p=pettanr%2Fpettanr.git;a=blobdiff_plain;f=app%2Fassets%2Fjavascripts%2Fmodels%2Fscroll_panel.js.coffee;h=e8065f509399df2bbe50f3937fc24ac4e10bc3ef;hp=f5b289ca48f6bd9fa26f8645c9442994fdff2bf3;hb=d7c8065be895b67dc453b0e11ad0f259f1ca6706;hpb=01bd644358713f599c11908152f12b911593b190 diff --git a/app/assets/javascripts/models/scroll_panel.js.coffee b/app/assets/javascripts/models/scroll_panel.js.coffee index f5b289ca..e8065f50 100644 --- a/app/assets/javascripts/models/scroll_panel.js.coffee +++ b/app/assets/javascripts/models/scroll_panel.js.coffee @@ -1,25 +1,41 @@ -class ScrollPanel extends Item - @single: () -> +class Pettanr.ScrollPanel extends Peta.Leaf + + @singular: () -> 'ScrollPanel' @plural: () -> 'ScrollPanels' defaults: { - id: 11 + id: null, + scroll_id: null, + panel_id: null, + t: null } - initialize: () -> - confirm("Welcome to Panel") + @pick_item_name: () -> + 'panel' + + @traceable_item_names: () -> + [] + + pick: (picked_item) -> + { + panel_id: picked_item.get('id'), + } + + @licensed_pictures: (scroll_panels) -> + panels = _.filter(scroll_panels, (sp) -> + sp.has_panel() + ) + Pettanr.Panel.licensed_pictures(panels) + + has_panel: () -> + if @get('panel_id') + true + else + false - @test: () -> - confirm( @single()) - confirm( @plural() ) - confirm( @class_name() ) - confirm( @element_name() ) - confirm( @table_name() ) - + initialize: (attr = {}, options = {}) -> + super(attr, options) - test: () -> - -@Panel = Panel