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

デザイン: レイアウトを変更 #57

Merged
merged 14 commits into from
Dec 22, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions app/assets/javascripts/application.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@
$( ->
$("[data-toggle='tooltip']").tooltip()
register_event_for_close_dialog()

if $('#notice').length > 0
height = $('#notice').css('height')
$('#notice')
.css({ height: 0 })
.delay(400)
.animate({ height: height })
.delay(5 * 1000)
.animate({ height: 0 })
)

register_event_for_close_dialog =->
Expand Down
15 changes: 7 additions & 8 deletions app/assets/javascripts/wall.js.coffee.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$( ->
initialize_masonry()
initialize_infinitescroll()
register_event_for_close_clip_detail_pane()
register_event_for_close_clip_dialog()
)

window.destroy_infinitescroll = ->
Expand Down Expand Up @@ -33,20 +33,14 @@ window.initialize_masonry = ($container) ->
$container.css({ opacity: 0 }).imagesLoaded( ->
@.removeClass('hidden')
@.masonry({
isFitWidth: true,
itemSelector: '.box',
isAnimated: false
})
@.animate({ opacity: 1 })
@.infinitescroll('retrieve') unless can_scroll()
)

window.register_event_for_close_clip_detail_pane =->
$(document).on('click', '#slide_overlay', ->
$('#clip_detail_pane').hide("slide", { direction: "right" }, 400, -> $(@).remove())
$('#slide_overlay').hide("fade", null, 400, -> $(@).remove())
$('body').removeClass('noscroll')
)

window.resize_images = ($container) ->
$container = $('#container') unless $container
$container.find('.image_box img').each( ->
Expand Down Expand Up @@ -89,3 +83,8 @@ infinitescroll_options = ->
window.can_scroll = ->
# documentだとinfiniscroll後、期待するコンテンツの高さが取得できないので'html'にする
$(window).height() <= $('html').height()

window.register_event_for_close_clip_dialog = ->
$(document).on('hide', '#clip_dialog', ->
$('body').removeClass('noscroll')
)
Loading