# Pick\r
@listenTo(this, 'ready', @ready)\r
speech_balloon_template = item\r
- writing_format = new Pettanr.WritingFormat({id: 1})\r
- writing_format.fetch({cache: true}).done =>\r
+ writing_format_list = Locmare.ListGroup.list(\r
+ 'writing_formats', 'index', {}\r
+ )\r
+ writing_format_list.open(() =>\r
+ writing_format = writing_format_list.items()[0]\r
templates = {\r
speech_balloon_template: speech_balloon_template,\r
writing_format: writing_format\r
}\r
new_item = new @target_model()\r
- new_item.set(new_item.pick(templates), {silent: true})\r
+ new_item.templates = templates\r
+ new_item.set(new_item.pick(), {silent: true})\r
new_item.boosts 'post'\r
- new_item.supply_default(templates)\r
+ new_item.supply_default()\r
# prepare balloon\r
balloon = new Pettanr.Balloon()\r
- balloon.set(balloon.pick(templates), {silent: true})\r
+ balloon.templates = templates\r
+ balloon.set(balloon.pick(), {silent: true})\r
balloon.boosts 'post'\r
- balloon.supply_default(templates)\r
+ balloon.supply_default()\r
# prepare speech\r
speech = new Pettanr.Speech()\r
- speech.set(speech.pick(templates), {silent: true})\r
+ speech.templates = templates\r
+ speech.set(speech.pick(), {silent: true})\r
speech.boosts 'post'\r
- speech.supply_default(templates)\r
+ speech.supply_default()\r
# join elements\r
new_item.set({balloon: balloon, speech: speech}, {silent: true})\r
@trigger('ready', new_item)\r
+ )\r
\r
ready: (new_item) ->\r
@dialog().stop()\r