Skip to content
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.

Commit

Permalink
refs #30 まとめ: クリップ追加キャンセル機能を作成
Browse files Browse the repository at this point in the history
  • Loading branch information
YOSHIDA Hiroki committed Nov 23, 2013
1 parent 6d3d754 commit a0c5fce
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions app/assets/javascripts/matomes_form.js.coffee.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,40 @@ $( ->
$image = $('<img/>')
$image.attr('src', $(@).attr('src'))
$image.attr('style', $(@).attr('style'))
$image.attr('data-clip-id', $(@).attr('data-clip-id'))
$image_box = $('<div/>')
$image_box.attr('class', 'image_box')
$image_box.html($image)
$box = $('<div/>')
$box.attr('class', 'box')
$box.html($image_box)
$box.append($hidden_data)

$(@).parent('.box').remove()
$container.masonry('reload')
$(@).closest('.box').remove()

$matome_container.append($box)
$matome_container.append($hidden_data)
$matome_container.masonry('reload')
$matome_dialog.dialog('close')
)

$matome_container.on('click', '.box img', ->
$image = $('<img/>')
$image.attr('src', $(@).attr('src'))
$image.attr('style', $(@).attr('style'))
$image.attr('data-clip-id', $(@).attr('data-clip-id'))
$box = $('<div/>')
$box.attr('class', 'box')
$box.html($image)

$(@).closest('.box').remove()
$matome_container.masonry('reload')

$container.append($box)
)

$('#new_clip').click( ->
open_matome_dialog()
$container.masonry('reload')
)

$('#load').click( ->
Expand Down

0 comments on commit a0c5fce

Please sign in to comment.