From ea6fbe04079382eef33b0c6dd175d69f91d83257 Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Fri, 10 Jul 2015 14:13:28 -0500 Subject: [PATCH] Fix fade effect when the iframe load - refs BT#9901 #TMI --- .../inc/lib/javascript/jquery.lp_minipanel.js | 26 +++++++------------ 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/main/inc/lib/javascript/jquery.lp_minipanel.js b/main/inc/lib/javascript/jquery.lp_minipanel.js index 509db308b9..55a3f263ff 100755 --- a/main/inc/lib/javascript/jquery.lp_minipanel.js +++ b/main/inc/lib/javascript/jquery.lp_minipanel.js @@ -24,24 +24,16 @@ $(document).ready(function() { }); // effects items scorm content - $('.scorm_item_normal').click(function() { - $('#learning_path_right_zone').fadeOut(300); - setTimeout(function(){ - $('#learning_path_right_zone').fadeIn(300); - },300); - }); + $('.scorm_item_normal, .scorm-previous, .scorm-next').on('click', function () { + $('#learning_path_right_zone').fadeOut('slow'); - $('.scorm-previous').click(function() { - $('#learning_path_right_zone').fadeOut(300); - setTimeout(function(){ - $('#learning_path_right_zone').fadeIn(300); - },300); - }); + var loadLearningPathRigthZone = function () { + $('#learning_path_right_zone').fadeIn(100); - $('.scorm-next').click(function() { - $('#learning_path_right_zone').fadeOut(300); - setTimeout(function(){ - $('#learning_path_right_zone').fadeIn(300); - },300); + $('#learning_path_right_zone iframe').off('load', loadLearningPathRigthZone); + }; + + $('#learning_path_right_zone iframe').on('load', loadLearningPathRigthZone); }); + });