Browse Source

update fix responsive section items scorm CT#9671

aragonc 10 years ago
parent
commit
cd9840a186
2 changed files with 50 additions and 40 deletions
  1. 11 1
      main/css/base.css
  2. 39 39
      main/newscorm/lp_view.php

+ 11 - 1
main/css/base.css

@@ -3377,7 +3377,7 @@ form .formw .freeze {
   padding-bottom: 10px;
 }
 .scorm_item_normal{
-  padding:10px;
+  padding:0;
   border-bottom: 1px solid #DCDCDC;
   border-left: 1px solid #DCDCDC;
   border-right: 1px solid #DCDCDC;
@@ -3394,6 +3394,9 @@ form .formw .freeze {
 .scorm_highlight a{
   color: #ffffff !important;
 }
+#scorm-info .panel-heading{
+  padding: 5px;
+}
 /* .scorm_item_normal .scorm_item_level_1{
   padding-left: 1.8em;
   padding-right: 1.5em;
@@ -5545,6 +5548,13 @@ ul.holder li.bit-box a.closebutton{
 #learning_path_left_zone #ui-option{
   width: 100%;
   display: block;
+  text-align: center;
+  cursor: pointer;
+}
+#learning_path_left_zone #ui-option #icon-up,
+#learning_path_left_zone #ui-option #icon-down{
+  width: 100%;
+  display: block;
 }
 .hidden{
   visibility: hidden;

+ 39 - 39
main/newscorm/lp_view.php

@@ -83,30 +83,13 @@ $(document).ready(function() {
 	$("div#log_content_cleaner").bind("click", function() {
     	$("div#log_content").empty();
 	});
-	//jQuery("video:not(.skip), audio:not(.skip)").mediaelementplayer();
 });
 var chamilo_xajax_handler = window.oxajax;
 </script>';
 
-$htmlHeadXtra[] = '<script type="text/javascript">
-        $(document).ready(function(){
-            $("#icon-down").click(function(){
-                $("#icon-up").removeClass("hidden");
-                $(this).addClass("hidden");
-            });
-             $("#icon-up").click(function(){
-                $("#icon-down").removeClass("hidden");
-                $(this).addClass("hidden");
-            });
-        });
 
-</script>';
 if ($_SESSION['oLP']->mode == 'embedframe' || $_SESSION['oLP']->get_hide_toc_frame()==1 ) {
-    $htmlHeadXtra[] = '<script>
-    $(document).ready(function() {
-        toggle_minipanel();
-    });
-    </script>';
+    $htmlHeadXtra[] = 'hello';
 }
 
 //Impress js
@@ -378,10 +361,10 @@ if ($is_allowed_to_edit) {
     /* Fin left zone */
     echo '<div class="container-fluid"><div class="row">';
     echo '<div id="learning_path_left_zone" class="sidebar-scorm"> ';
-    echo '<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">';
-    echo '<div class="panel panel-default">';
-    echo '<div class="panel-heading" role="tab" id="headingOne">
-        <a id="ui-option" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
+
+    echo '<div id="scorm-info" class="panel panel-default">';
+    echo '<div class="panel-heading">
+        <a id="ui-option">
         <i id="icon-down"class="fa fa-chevron-down hidden"></i>
         <i id="icon-up" class="fa fa-chevron-up"></i>
         </a></div>';
@@ -389,8 +372,7 @@ if ($is_allowed_to_edit) {
         <!-- end header -->
 
         <!-- Author image preview -->
-    <div id="collapseOne" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingOne">
-            <div class="panel-body">
+            <div id="panel-scorm" class="panel-body">
                 <?php
                 // Return to course home.
                 if ($is_allowed_to_edit) {
@@ -450,9 +432,9 @@ if ($is_allowed_to_edit) {
                     echo '</div>';
                 }
                 ?>
-            </div>
-        </div>
+
         </div>
+
     </div>
 
         <!-- TOC layout -->
@@ -490,23 +472,22 @@ if ($is_allowed_to_edit) {
     function updateContentHeight() {
         document.body.style.overflow = 'hidden';
         var IE = window.navigator.appName.match(/microsoft/i);
-        var heightHeader = ($('#header').height())? $('#header').height() : 0 ;
-        var heightAuthorImg = ($('#author_image').height())? $('#author_image').height() : 0 ;
-        var heightAuthorName = ($('#author_name').height())? $('#author_name').height() : 0 ;
-        var heightBreadcrumb = ($('#learning_path_breadcrumb_zone').height())? $('#learning_path_breadcrumb_zone').height() : 0 ;
+
+        /* Identified new height */
         var heightControl = ($('#control').is(':visible'))? $('#control').height() : 0 ;
-        var heightMedia = ($('#lp_media_file').length != 0)? $('#lp_media_file').height() : 0 ;
-        //var heightTitle = ($('#scorm_title').height())? $('#scorm_title').height() : 0 ;
-        var heightAction = ($('#actions_lp').height())? $('#actions_lp').height() : 0 ;
+        var heightBreadcrumb = ($('#learning_path_breadcrumb_zone').height())? $('#learning_path_breadcrumb_zone').height() : 0 ;
+
+        var heightScormInfo = $('#scorm-info').height();
+
+        var heightTop = heightScormInfo + 100;
 
-        //var heightTop = heightHeader + heightAuthorImg + heightAuthorName + heightMedia + heightTitle + heightAction + 100;
-        var heightTop = heightHeader + heightAuthorImg + heightAuthorName + heightMedia + heightAction + 100;
+        //heightTop = (heightTop > 300)? heightTop : 300;
 
-        heightTop = (heightTop < 300)? heightTop : 300;
-        var innerHeight = (IE) ? document.body.clientHeight : window.innerHeight ;
-        // -40 is a static adjustement for margin, spaces on the page
+        var innerHeight = $(window).height();
 
-        $('#inner_lp_toc').css('height', innerHeight - heightTop - heightBreadcrumb - heightControl + "px");
+        //var innerHeight = (IE) ? document.body.clientHeight : window.innerHeight ;
+
+        $('#inner_lp_toc').css('height',  innerHeight - heightBreadcrumb - heightTop + "px");
         if ($('#content_id')) {
             $('#content_id').css('height', innerHeight - heightBreadcrumb - heightControl + "px");
         }
@@ -558,6 +539,25 @@ if ($is_allowed_to_edit) {
     });
     window.onload = updateContentHeight();
     window.onresize = updateContentHeight();
+
+    $(document).ready(function(){
+
+        $("#icon-down").click(function(){
+            $("#icon-up").removeClass("hidden");
+            $(this).addClass("hidden");
+            $('#panel-scorm').slideDown("slow",function(){
+                updateContentHeight();
+            });
+        });
+        $("#icon-up").click(function(){
+            $("#icon-down").removeClass("hidden");
+            $(this).addClass("hidden");
+            $('#panel-scorm').slideUp("slow",function(){
+                updateContentHeight();
+            });
+        });
+    });
+
 </script>
 <?php
 // Restore a global setting.