Permalink
Browse files

Fixed modal-title display

Modified logic in updateTitleAndFooter() so modal-title always follows the "always_show_close" option.

Before, when "always_show_close" set to false, only first modal had hidden title - when navigating left/right the title showed, even when empty (because of "nbsp;").
  • Loading branch information...
leibrug committed May 20, 2014
1 parent 2903872 commit 88be1141adf3c15005db1797de38abd7b7023748
Showing with 4 additions and 4 deletions.
  1. +4 −4 ekko-lightbox.coffee
View
@@ -178,10 +178,10 @@ EkkoLightbox.prototype = {
updateTitleAndFooter: ->
header = @modal_content.find('.modal-header')
footer = @modal_content.find('.modal-footer')
title = @$element.data('title') || " "
title = @$element.data('title') || ""
caption = @$element.data('footer') || ""
header.css('display', '').find('.modal-title').html(title)
if title or @options.always_show_close then header.css('display', '') else header.css('display', 'none')
if title or @options.always_show_close then header.css('display', '').find('.modal-title').html(title || " ") else header.css('display', 'none')
if caption then footer.css('display', '').html(caption) else footer.css('display', 'none')
@
@@ -278,4 +278,4 @@ $.fn.ekkoLightbox.defaults = {
onShown : ->
onHide : ->
onHidden : ->
}
}

0 comments on commit 88be114

Please sign in to comment.