From f784564fa34f4a6e10a25314c0c6fb065c4e63d0 Mon Sep 17 00:00:00 2001 From: Chris Hallberg <crhallberg@gmail.com> Date: Thu, 11 Sep 2014 12:12:44 -0400 Subject: [PATCH] Lightbox title set then overwritten fix. --- themes/bootstrap3/js/lightbox.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/themes/bootstrap3/js/lightbox.js b/themes/bootstrap3/js/lightbox.js index 9a5df30326e..384afb29689 100644 --- a/themes/bootstrap3/js/lightbox.js +++ b/themes/bootstrap3/js/lightbox.js @@ -90,9 +90,10 @@ var Lightbox = { * Hide the header if it's empty to make more * room for content and avoid double headers. */ - changeContent: function(html, headline) { + titleSet: false, + changeContent: function(html) { var header = $('#modal .modal-header'); - if(typeof headline === "undefined") { + if(!Lightbox.titleSet) { var h2 = html.match(/<h2>([^<]*)<\/h2>/); if(h2) { header.find('.modal-title').html(h2[1]); @@ -102,8 +103,7 @@ var Lightbox = { header.find('.modal-title').html(pLead[1]); } } - } else { - header.find('.modal-title').html(headline); + Lightbox.titleSet = false; } if(header.find('.modal-title').html().length == 0) { header.css('border-bottom-width', '0'); @@ -406,5 +406,6 @@ $(document).ready(function() { title = $(this).html(); } $('#modal .modal-title').html(title); + Lightbox.titleSet = true; }); }); \ No newline at end of file -- GitLab