OSDN Git Service
(root)
/
pettanr
/
pettanr.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
t#:
[pettanr/pettanr.git]
/
app
/
assets
/
javascripts
/
models
/
panel.js.coffee
diff --git
a/app/assets/javascripts/models/panel.js.coffee
b/app/assets/javascripts/models/panel.js.coffee
index
22102c5
..
fec6673
100644
(file)
--- a/
app/assets/javascripts/models/panel.js.coffee
+++ b/
app/assets/javascripts/models/panel.js.coffee
@@
-58,16
+58,30
@@
class Pettanr.Panel extends Peta.Root
label: (shorten_length) ->
\r
@_label('caption', shorten_length)
\r
\r
label: (shorten_length) ->
\r
@_label('caption', shorten_length)
\r
\r
+ play: () ->
\r
+ new Pettanr.Panel.Play({id: @get('id')})
\r
+
\r
+ edit: (options) ->
\r
+ i = new Pettanr.Panel.Edit({id: @get('id')})
\r
+ i.load(options)
\r
+
\r
initialize: (attr = {}, options = {}) ->
\r
super(attr, options)
\r
@set(attr)
\r
\r
initialize: (attr = {}, options = {}) ->
\r
super(attr, options)
\r
@set(attr)
\r
\r
-class Pettanr.Panel.
WithElements
extends Pettanr.Panel
\r
+class Pettanr.Panel.
Play
extends Pettanr.Panel
\r
\r
fetch: (options) ->
\r
@url = @default_url() + '?with_elements=true'
\r
super(options)
\r
\r
\r
fetch: (options) ->
\r
@url = @default_url() + '?with_elements=true'
\r
super(options)
\r
\r
+class Pettanr.Panel.Edit extends Pettanr.Panel.Play
\r
+
\r
+ load: (options) ->
\r
+ @fetch().done =>
\r
+ @attributes = @decoded_attributes()
\r
+ @load_elements(options)
\r
+
\r
save: (attrs) ->
\r
@url = @default_url()
\r
method = if @isNew()
\r
save: (attrs) ->
\r
@url = @default_url()
\r
method = if @isNew()
\r