リビジョン | 59535c9a030167616214c63d32ebbee59a9a59bb (tree) |
---|---|
日時 | 2015-05-27 14:20:53 |
作者 | yasushiito <yas@pen-...> |
コミッター | yasushiito |
fix: publisher
@@ -25,6 +25,9 @@ class Pettanr.OriginalPicturesController extends Pettanr.AppController | ||
25 | 25 | show = new Pettanr.Views.OriginalPicture.Show({ |
26 | 26 | item: @item, |
27 | 27 | }) |
28 | + @listenTo(show, 'click:license', @click_license) | |
29 | + @listenTo(show, 'success', @publish) | |
30 | + @listenTo(show, 'click:close', @close_dialog) | |
28 | 31 | show.render() |
29 | 32 | @trigger('ready', show) |
30 | 33 | @trigger('done', @params) |
@@ -53,6 +56,15 @@ class Pettanr.OriginalPicturesController extends Pettanr.AppController | ||
53 | 56 | @trigger('ready', @form) |
54 | 57 | @trigger('lock', @params, @form) |
55 | 58 | |
59 | + click_license: (dialog) -> | |
60 | + @trigger('lock', @params, dialog) | |
61 | + | |
62 | + publish: (dialog) -> | |
63 | + @trigger('unlock', @params, dialog) | |
64 | + | |
65 | + close_dialog: (dialog) -> | |
66 | + @trigger('unlock', @params, dialog) | |
67 | + | |
56 | 68 | create: () -> |
57 | 69 | @listenTo(@form, 'success', @post_success) |
58 | 70 | @listenTo(@form, 'fail', @post_fail) |
@@ -54,3 +54,6 @@ class Editor.PicturePublisher.Dialog extends Editor.Dialog | ||
54 | 54 | success: (resource_picture) -> |
55 | 55 | @trigger('success', resource_picture) |
56 | 56 | |
57 | + quit: () -> | |
58 | + @remove() | |
59 | + |
@@ -117,6 +117,10 @@ class Pettanr.Views.OriginalPicture.Show extends Backbone.View | ||
117 | 117 | |
118 | 118 | click_license: () -> |
119 | 119 | @create_dialog() |
120 | + @trigger('click:license', @dialog) | |
121 | + #retriever = new Pettanr.Cache.Retriever(@item.my_class(), @item.get('id')) | |
122 | + #@listenTo(retriever, 'retrieve', @create_dialog) | |
123 | + #retriever.edit() | |
120 | 124 | |
121 | 125 | click_edit: () -> |
122 | 126 | @trigger('http_get', @item.edit_url()) |
@@ -135,7 +139,7 @@ class Pettanr.Views.OriginalPicture.Show extends Backbone.View | ||
135 | 139 | width: 500, |
136 | 140 | height: 500, |
137 | 141 | close: (ui, event) -> |
138 | - _this.remove() | |
142 | + _this.close_dialog() | |
139 | 143 | }) |
140 | 144 | params = { |
141 | 145 | controller: 'original_picture_license_groups', action: 'new', id: @item.get('id'), |
@@ -148,6 +152,12 @@ class Pettanr.Views.OriginalPicture.Show extends Backbone.View | ||
148 | 152 | false |
149 | 153 | |
150 | 154 | success: (resource_picture) -> |
151 | - @dialog.remove() | |
155 | + #Pettanr.cache.fix(@item) | |
156 | + @trigger('success', @params, @dialog) | |
152 | 157 | @trigger('http_get', resource_picture.show_url()) |
158 | + Pettanr.cache.refresh(@item) | |
159 | + | |
160 | + close_dialog: () -> | |
161 | + #Pettanr.cache.release(@item) | |
162 | + @trigger('click:close', @dialog) | |
153 | 163 |