Browse Source

Merge pull request #772 from AngelFQC/BT9901

Fix LP with exercises JS/CSS - refs BT#9901 #TMI
Angel Fernando Quiroz Campos 9 years ago
parent
commit
aeeff7a8b0

+ 8 - 10
main/exercice/overview.php

@@ -211,7 +211,7 @@ if (!empty($attempts)) {
         $i--;
     }
 
-    $table = new HTML_Table(array('class' => 'data_table'));
+    $table = new HTML_Table(array('class' => 'table table-striped table-hover'));
 
     //Hiding score and answer
     switch ($objExercise->results_disabled) {
@@ -241,11 +241,7 @@ if (!empty($attempts)) {
         foreach ($my_attempt_array as $data) {
             $column = 0;
             $table->setCellContents($row, $column, $data);
-            $class = 'class="row_odd"';
-            if($row % 2) {
-                $class = 'class="row_even"';
-            }
-            $table->setRowAttributes($row, $class, true);
+            $table->setRowAttributes($row, null, true);
             $column++;
             $row++;
         }
@@ -282,10 +278,12 @@ if (!empty($exercise_url_button)) {
     );
 }
 
-$html .= $table_content;
+$html .= Display::tag(
+    'div',
+    $table_content,
+    ['class' => 'table-responsive']
+);
 $html.= '</div>';
 echo $html;
 
-if ($origin != 'learnpath') {
-    Display::display_footer();
-}
+Display::display_footer();

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

+ 0 - 16
main/template/default/layout/footer.tpl

@@ -72,22 +72,6 @@
     </div>
 </div>
 
-{# Global modal, load content by AJAX call to href attribute on anchor tag with 'ajax' class #}
-<div class="modal fade" id="global-modal" tabindex="-1" role="dialog" aria-labelledby="global-modal-title" aria-hidden="true">
-    <div class="modal-dialog modal-lg">
-        <div class="modal-content">
-            <div class="modal-header">
-                <button type="button" class="close" data-dismiss="modal" aria-label="{{ "Close" | get_lang }}">
-                    <span aria-hidden="true">&times;</span>
-                </button>
-                <h4 class="modal-title" id="global-modal-title">&nbsp;</h4>
-            </div>
-            <div class="modal-body">
-            </div>
-        </div>
-    </div>
-</div>
-
 <script>
     $("form").on("click", ' .advanced_parameters', function() {
         /*var id = $(this).attr('id') + '_options';

+ 16 - 0
main/template/default/layout/main_footer.tpl

@@ -1,5 +1,21 @@
 {% if show_footer == true %}
     {% include template ~ "/layout/footer.tpl" %}
 {% endif %}
+
+    {# Global modal, load content by AJAX call to href attribute on anchor tag with 'ajax' class #}
+    <div class="modal fade" id="global-modal" tabindex="-1" role="dialog" aria-labelledby="global-modal-title" aria-hidden="true">
+        <div class="modal-dialog modal-lg">
+            <div class="modal-content">
+                <div class="modal-header">
+                    <button type="button" class="close" data-dismiss="modal" aria-label="{{ "Close" | get_lang }}">
+                        <span aria-hidden="true">&times;</span>
+                    </button>
+                    <h4 class="modal-title" id="global-modal-title">&nbsp;</h4>
+                </div>
+                <div class="modal-body">
+                </div>
+            </div>
+        </div>
+    </div>
 </body>
 </html>