X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=app%2Fassets%2Fjavascripts%2Fmodels%2Ffolder.js.coffee;h=a74d5658de4a922b2b34ed16d0d6d09332e7d2a8;hb=083cd052b6a10be6ddb3534307176f8c415952a8;hp=5e8e8b3ef7628433479aa733972033a291d3dc59;hpb=8ac511ef3fe4274530bebcfc5781a614507c3941;p=pettanr%2Fpettanr.git diff --git a/app/assets/javascripts/models/folder.js.coffee b/app/assets/javascripts/models/folder.js.coffee index 5e8e8b3e..a74d5658 100644 --- a/app/assets/javascripts/models/folder.js.coffee +++ b/app/assets/javascripts/models/folder.js.coffee @@ -16,8 +16,8 @@ class Pettanr.Folder extends Peta.Owner @get('name').replace(/\/$/, '').split('/').pop() filer_caption: () -> - @caption_text = _.escape(@caption()) - @trigger('ready:caption') + caption = _.escape(@caption()) + @trigger('ready:caption', caption) is_remote: () -> if @get('category_id') == 10 @@ -28,6 +28,14 @@ class Pettanr.Folder extends Peta.Owner remote_name: () -> Pettanr.to_s(@get('controller_name')) + '/' + Pettanr.to_s(@get('action_name')) + remote_url: () -> + c = @get('controller_name') + a = if Pettanr.is_blank(@get('action_name')) + 'index' + else + @get('action_name') + c + '/' + a + event_name: () -> a = if Pettanr.is_blank(@get('action_name')) 'index' @@ -35,7 +43,8 @@ class Pettanr.Folder extends Peta.Owner @get('action_name') Pettanr.to_s(@get('controller_name')) + '_' + a - initialize: () -> + initialize: (attr = {}, options = {}) -> + super(attr, options) if @id @url = @url + @id