[6064] learningpath : if setting "hide_toc" is activated, the the toc is hidden by javascript

skala
Noel Dieschburg 15 years ago
parent de6ef77df8
commit 4928a8de91
  1. 67
      main/inc/lib/javascript/jquery.lp_minipanel.js
  2. 2
      main/newscorm/lp_view.php

@ -4,33 +4,7 @@
Requirements: JQuery 1.4.4, JQuery UI 1.8.7
Alberto Torreblanca @albert1t0
*******************************************/
(function($){
$(document).ready(function() {
//Adding div to hide panel
$('#learning_path_right_zone').
before('<div id="hide_bar" style="float: left; width: 10px; height: 100%;">' +
'<table style="border: 0 none; width: 100%; height: 100%; cursor: pointer; background-color: #EEEEEE">' +
'<tr> <td> </td></tr></table></div>');
$('#hide_bar table').css({backgroundImage: "url(../img/hide0.png)", backgroundRepeat: "no-repeat", backgroundPosition: "center center"})
//Adding effects to hide bar
$('#hide_bar table').hover(function (){
if($('#hide_bar').position().left == 280)
$(this).css('backgroundImage','url(../img/hide1.png)').css('backgroundColor','#888888');
else if($('#hide_bar').position().left == 0)
$(this).css('backgroundImage','url(../img/hide3.png)').css('backgroundColor','#888888');
},function (){
if($('#hide_bar').position().left == 280)
$(this).css('backgroundImage','url(../img/hide0.png)').css('backgroundColor','#EEEEEE');
else if($('#hide_bar').position().left == 0)
$(this).css('backgroundImage','url(../img/hide2.png)').css('backgroundColor','#EEEEEE');
}
);
// Adding funcionality
$('#hide_bar table').toggle(function(){
function display_hide_toc(){
// Copy little progress bar in <tr></tr>
function minipb(){
@ -45,6 +19,7 @@
$('#learning_path_main #control tr:eq(1) div').css('width','');
}
if($('#hide_bar').position().left == 280){
// Construct mini panel
var panel = $('#lp_navigation_elem div:first').clone();
$(panel).attr('id','control');
@ -81,12 +56,44 @@
$('#learning_path_right_zone').css('margin-left','10px');
$('#hide_bar table').css('backgroundImage','url(../img/hide2.png)').css('backgroundColor','#EEEEEE');
},function(){
}else{
// Show navigation left zone
$('#hide_bar table').css('backgroundImage','url(../img/hide0.png)').css('backgroundColor','#EEEEEE');
$('#learning_path_right_zone').css('marginLeft','290px');
$('#learning_path_left_zone').show(50);
$('#learning_path_main #control').remove();
});
}
}
(function($){
$(document).ready(function() {
//Adding div to hide panel
$('#learning_path_right_zone').
before('<div id="hide_bar" style="float: left; width: 10px; height: 100%;">' +
'<table style="border: 0 none; width: 100%; height: 100%; cursor: pointer; background-color: #EEEEEE">' +
'<tr> <td> </td></tr></table></div>');
if($('#hide_bar').position().left == 0)
$('#hide_bar table').css({backgroundImage: "url(../img/hide2.png)", backgroundRepeat: "no-repeat", backgroundPosition: "center center"})
else
$('#hide_bar table').css({backgroundImage: "url(../img/hide0.png)", backgroundRepeat: "no-repeat", backgroundPosition: "center center"})
//Adding effects to hide bar
$('#hide_bar table').hover(function (){
if($('#hide_bar').position().left == 280)
$(this).css('backgroundImage','url(../img/hide1.png)').css('backgroundColor','#888888');
else if($('#hide_bar').position().left == 0)
$(this).css('backgroundImage','url(../img/hide3.png)').css('backgroundColor','#888888');
},function (){
if($('#hide_bar').position().left == 280)
$(this).css('backgroundImage','url(../img/hide0.png)').css('backgroundColor','#EEEEEE');
else if($('#hide_bar').position().left == 0)
$(this).css('backgroundImage','url(../img/hide2.png)').css('backgroundColor','#EEEEEE');
}
);
// Adding funcionality
$('#hide_bar table').toggle(
display_hide_toc, display_hide_toc);
});
})(jQuery);
})(jQuery);

@ -271,7 +271,7 @@ $display_none = '';
$margin_left = '290px';
if ($_SESSION['oLP']->mode == 'embedframe' ||$_SESSION['oLP']->get_hide_toc_frame()==1 ) {
$display_none = ';display:none;';
$margin_left = '0px';
$margin_left = '12px';
}
?>
<body dir="<?php echo api_get_text_direction(); ?>">

Loading…
Cancel
Save