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
fix:balloon edit
[pettanr/pettanr.git]
/
app
/
assets
/
javascripts
/
models
/
system_picture.js.coffee
diff --git
a/app/assets/javascripts/models/system_picture.js.coffee
b/app/assets/javascripts/models/system_picture.js.coffee
index
bd5daa6
..
36bda58
100644
(file)
--- a/
app/assets/javascripts/models/system_picture.js.coffee
+++ b/
app/assets/javascripts/models/system_picture.js.coffee
@@
-11,6
+11,9
@@
class Pettanr.SystemPicture extends Peta.SystemResource
id: null
\r
}
\r
\r
id: null
\r
}
\r
\r
+ picture: () ->
\r
+ new Pettanr.Cache.Retriever(Pettanr.Picture, @get('picture_id'))
\r
+
\r
filename: () ->
\r
@get('id') + '.' + @get('ext')
\r
\r
filename: () ->
\r
@get('id') + '.' + @get('ext')
\r
\r
@@
-31,15
+34,16
@@
class Pettanr.SystemPicture extends Peta.SystemResource
picture: this
\r
})
\r
\r
picture: this
\r
})
\r
\r
- symbol_option: (cb) ->
\r
- _this = this
\r
- this.fetch().done ->
\r
- cb(_this.tmb_opt_img_tag())
\r
+ symbol_option: () ->
\r
+ retriever = @retriever()
\r
+ @listenTo(retriever, 'retrieve', @retrieve_symbol)
\r
+ retriever.retrieve()
\r
+
\r
+ retrieve_symbol: (item) ->
\r
+ @trigger('ready:symbol', item.tmb_opt_img_tag())
\r
\r
\r
- initialize: () ->
\r
+ initialize: (attr = {}, options = {}) ->
\r
+ super(attr, options)
\r
if @id
\r
@url = @url + @id
\r
\r
if @id
\r
@url = @url + @id
\r
\r
-class Pettanr.SystemPicture.Collection extends Backbone.Collection
\r
- model: Pettanr.SystemPicture
\r
- url: '/system_pictures'
\r