class Pettanr.PanelsController extends Pettanr.AppController index: () -> @redraw_title(@params) @filer_list() by_author: () -> @redraw_title(@params) @filer_list() by_scroll: () -> @redraw_title(@params) @filer_list() by_sheet: () -> @redraw_title(@params) @filer_list() by_speech_balloon_template: () -> @redraw_title(@params) @filer_list() show_html: () -> @item = new Pettanr.Panel({id: @item.get('id')}, {with_elements: true}) # retake panel for 'with_elements' mode @item.fetch({cache: false}).done => @redraw_title(@params, @item.get('caption')) view = new Pettanr.Views.Panel.Show({ el: "#pettanr", panel: @item, operators: @operators, spot: null }) view.render() false show: () -> @set_show() switch @params['format'] when 'prof' @show_prof() else @show_html() count: () -> new: () -> @redraw_title(@params) @set_new() editor = new Editor.PanelEditor({root_item: @item, operators: @operators}) $("#pettanr").html(editor.render().el) edit: () -> @redraw_title(@params) @set_model() @item = new Pettanr.Panel({id: @params['id']}, {with_elements: true}) @item.fetch({cache: false}).done => editor = new Editor.PanelEditor({root_item: @item, operators: @operators}) $("#pettanr").html(editor.render().el) create: () -> update: () -> destroy: () ->