From 5e454a076bb182827816a75dff4b9b72f786dfaf Mon Sep 17 00:00:00 2001 From: Alejandro Gallardo Escobar Date: Tue, 30 Dec 2014 12:36:19 +0100 Subject: [PATCH] Improved the function "forced_title_callback" to use the element title in a special case --- pandora_console/include/javascript/jquery.pandora.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/javascript/jquery.pandora.js b/pandora_console/include/javascript/jquery.pandora.js index 97d8f69b98..8179d3780d 100644 --- a/pandora_console/include/javascript/jquery.pandora.js +++ b/pandora_console/include/javascript/jquery.pandora.js @@ -181,7 +181,16 @@ function forced_title_callback() { // Put title in the layer /////////////////////////////////////////// - var title = $('#forced_title_'+img_id).html(); + // If the '.forced_title' element has 'use_title_for_force_title' = 1 + // into their 'data' prop, the element title will be used for the + // content. + if ($(this).data("use_title_for_force_title")) { + var title = $(this).prop("title"); + } + else { + var title = $('#forced_title_'+img_id).html(); + } + $('#forced_title_layer').html(title); ///////////////////////////////////////////