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: views
[pettanr/pettanr.git]
/
app
/
assets
/
javascripts
/
views
/
pictures
/
history.js.coffee
diff --git
a/app/assets/javascripts/views/pictures/history.js.coffee
b/app/assets/javascripts/views/pictures/history.js.coffee
index
16b6c9a
..
58e4fc4
100644
(file)
--- a/
app/assets/javascripts/views/pictures/history.js.coffee
+++ b/
app/assets/javascripts/views/pictures/history.js.coffee
@@
-6,28
+6,29
@@
class Pettanr.Views.Picture.History extends Pettanr.View
\r
render: () ->
\r
this.$el.html('')
\r
\r
render: () ->
\r
this.$el.html('')
\r
- r = new Tag.A({
\r
- attr: {href: '/' + @item.show_url()},
\r
- content: @item.get('revision')
\r
+ r = new Pettanr.View.Button(@item.show_url(), @item.get('revision'), {
\r
+ context: this,
\r
+ click: () =>
\r
+ @trigger('http_get', @item.show_url())
\r
})
\r
})
\r
- @listenTo(r, 'click', @click_show)
\r
h = new Tag.H3({
\r
content: Pettanr.AppHelper.t_m('Picture.revision') + ':'
\r
})
\r
d = new Tag.Div({
\r
content: Pettanr.AppHelper.t_m('Picture.created_at') + ':' + @item.get('created_at')
\r
})
\r
h = new Tag.H3({
\r
content: Pettanr.AppHelper.t_m('Picture.revision') + ':'
\r
})
\r
d = new Tag.Div({
\r
content: Pettanr.AppHelper.t_m('Picture.created_at') + ':' + @item.get('created_at')
\r
})
\r
- credit = @item.credit_view()
\r
- @listenTo(credit, 'click:icon', @click_icon)
\r
this.$el.append(h.render().el)
\r
h.$el.append(r.render().el)
\r
this.$el.append(d.render().el)
\r
this.$el.append(h.render().el)
\r
h.$el.append(r.render().el)
\r
this.$el.append(d.render().el)
\r
-
this.$el.append(credit.render().el
)
\r
+
@add_credit(@item
)
\r
this
\r
\r
this
\r
\r
- click_
show
: () ->
\r
+ click_
credit_icon
: () ->
\r
@trigger('http_get', @item.show_url())
\r
\r
@trigger('http_get', @item.show_url())
\r
\r
- click_icon: () ->
\r
- @trigger('http_get', @item.show_url())
\r
+ add_credit: (picture, options = {icon: true}) ->
\r
+ credit = new Pettanr.View.Credit(picture, options)
\r
+ this.$el.append(credit.render().el)
\r
+ @listenTo(credit, 'click:icon', @click_credit_icon)
\r
+ @append_rb()
\r
\r
\r