Browse Source

Fix fade effect when the iframe load - refs BT#9901 #TMI

Angel Fernando Quiroz Campos 9 years ago
parent
commit
ea6fbe0407
1 changed files with 9 additions and 17 deletions
  1. 9 17
      main/inc/lib/javascript/jquery.lp_minipanel.js

+ 9 - 17
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);
     });
+
 });