• R/O
  • HTTP
  • SSH
  • HTTPS

pettanr: コミット

サーバ側、Railsシステム本体


コミットメタ情報

リビジョンae200a3226cc6407ab381a81ed65f5d7ee557449 (tree)
日時2015-11-09 07:02:43
作者yasushiito <yas@pen-...>
コミッターyasushiito

ログメッセージ

fix: scenario

変更サマリ

差分

--- a/app/assets/javascripts/editor/panel_editor/dock.js.coffee
+++ b/app/assets/javascripts/editor/panel_editor/dock.js.coffee
@@ -96,6 +96,7 @@ class Editor.PanelEditor.Dock extends Editor.EditorModule.DockBase
9696 # merge panel and elements
9797 attrs = @root_bay.save_data()
9898 _.extend(attrs, @element_bay.save_data())
99+ $.extend(true, attrs, @scenario_bay.save_data()) # deep merge by jQuery
99100 # save json data by panel form
100101 @root_bay.body.form.save(attrs)
101102
--- a/app/assets/javascripts/editor/panel_editor/scenario.js.coffee
+++ b/app/assets/javascripts/editor/panel_editor/scenario.js.coffee
@@ -23,7 +23,7 @@ class Editor.EditorModule.DockModule.ScenarioBay extends Editor.EditorModule.Doc
2323 @add_element(new_item)
2424
2525 save_data: () ->
26- @body.form.save_data()
26+ @body.save_data()
2727
2828 length: () ->
2929 @body.length()
@@ -70,3 +70,12 @@ class Editor.EditorModule.DockModule.TabModule.ScenarioBayBody extends Editor.Ed
7070 length: () ->
7171 @elements.element_lis.length
7272
73+ save_data: () ->
74+ attrs = {}
75+ _.each @elements.element_lis, (element_li) ->
76+ form = element_li.body.form
77+ name = form.item.table_name() + '_attributes'
78+ attrs[name] ||= []
79+ attrs[name].push(form.save_data())
80+ attrs
81+
--- a/app/assets/javascripts/views/balloons/element.js.coffee
+++ b/app/assets/javascripts/views/balloons/element.js.coffee
@@ -18,7 +18,7 @@ class Pettanr.Views.Balloon.Element extends Pettanr.View
1818 set_style: () ->
1919 attr = {
2020 src: @system_picture.picture_file().src(),
21- alt: @element.get('caption'),
21+ alt: @speech_balloon.element.get('caption'),
2222 style: Pettanr.to_style(@style())
2323 }
2424 this.$el.attr(attr)
--- a/app/models/panel_picture.rb
+++ b/app/models/panel_picture.rb
@@ -104,7 +104,9 @@ class PanelPicture < Peta::Element
104104 o = (spot and spot != self) ? "opacity: #{opacity.to_f/100}; filter:alpha(opacity=#{opacity});" : ''
105105 self.tag_attributes(:img, {
106106 :class => "panel-picture", :vPicture => self.id,
107- :src => self.url, :width => self.width.abs, :height => self.height.abs, :picture_id => self.picture_id, :ext => self.picture.ext, :alt => self.caption,
107+ :src => self.url, :width => self.width.abs, :height => self.height.abs,
108+ :picture_id => self.picture_id, :ext => self.picture.ext,
109+ :alt => self.caption,
108110 :style => "#{o}"
109111 })
110112 end
旧リポジトリブラウザで表示