Skip to content
Snippets Groups Projects
Commit f371abcc authored by Chris Hallberg's avatar Chris Hallberg
Browse files

VuDL fix 2 - Bootstrap 2

parent 76935f4a
No related merge requests found
...@@ -115,7 +115,7 @@ function prevPage() { ...@@ -115,7 +115,7 @@ function prevPage() {
$('.page-link.selected').prev('.page-link').click(); $('.page-link.selected').prev('.page-link').click();
scrollToSelected(); scrollToSelected();
} }
function nextPage() { function nextPage() {
$('.page-link.selected').next('.page-link').click(); $('.page-link.selected').next('.page-link').click();
scrollToSelected(); scrollToSelected();
} }
...@@ -124,6 +124,9 @@ function scrollToSelected() { ...@@ -124,6 +124,9 @@ function scrollToSelected() {
scrollTop: $('#collapse1 .selected').offset().top-$('#collapse1').offset().top+$('#collapse1').scrollTop()-12 scrollTop: $('#collapse1 .selected').offset().top-$('#collapse1').offset().top+$('#collapse1').scrollTop()-12
}); });
} }
function scrollAdjust() {
$('#collapse1').scrollTop($('#'+topScrollItem).offset().top-$('#collapse1').offset().top+$('#collapse1').scrollTop());
}
// Accordion size // Accordion size
function resizeAccordions(offset) { function resizeAccordions(offset) {
var accordionHeight = window.innerHeight // Window height var accordionHeight = window.innerHeight // Window height
...@@ -168,7 +171,7 @@ $(document).ready(function() { ...@@ -168,7 +171,7 @@ $(document).ready(function() {
$('.page-link').click(function() { $('.page-link').click(function() {
$('.page-link.selected').removeClass('selected'); $('.page-link.selected').removeClass('selected');
$(this).addClass('selected'); $(this).addClass('selected');
}); });
// Load clicked items // Load clicked items
$('.unloaded').click(function() { $('.unloaded').click(function() {
scrollToSelected(); scrollToSelected();
...@@ -182,6 +185,16 @@ $(document).ready(function() { ...@@ -182,6 +185,16 @@ $(document).ready(function() {
}); });
setTimeout(findVisible, 1000); setTimeout(findVisible, 1000);
ajaxGetView(initPage); ajaxGetView(initPage);
// Track top item in the scroll bar
$('.accordion-body').scroll(function(e){
var pageLinks = $('.page-link');
for(var i=0;i<pageLinks.length;i++) {
if($(pageLinks[i]).position().top >= 0) {
topScrollItem = pageLinks[i].id;
break;
}
}
});
}); });
// Initial alignment // Initial alignment
$( window ).load( scrollToSelected ); $( window ).load( scrollToSelected );
......
<? <?
$this->headTitle($this->translate($this->title) .' - '. $this->details['title']['value']); $this->headTitle($this->translate($this->title) .' - '. $this->details['title']['value']);
// Multiple breadcrumbs // Multiple breadcrumbs
$this->layout()->breadcrumbs = $this->parents; $this->layout()->breadcrumbs = $this->parents;
$this->layout()->title = $this->details['title']['value']; $this->layout()->title = $this->details['title']['value'];
$this->layout()->breadcrumbEnd = $this->breadcrumbEnd; $this->layout()->breadcrumbEnd = $this->breadcrumbEnd;
$this->layout()->from = $this->from; $this->layout()->from = $this->from;
// Get first list name // Get first list name
foreach($this->outline as $list=>$v) { foreach($this->outline as $list=>$v) {
if($list == 'counts') continue; if($list == 'counts') continue;
...@@ -34,14 +34,14 @@ ...@@ -34,14 +34,14 @@
// AUDIO // AUDIO
//$this->headLink()->appendStylesheet('jplayer.css'); //$this->headLink()->appendStylesheet('jplayer.css');
$this->headScript()->appendFile('http://www.google.com/jsapi'); $this->headScript()->appendFile('http://www.google.com/jsapi');
// Compact header // Compact header
$this->layout()->headerType = 'record'; $this->layout()->headerType = 'record';
$this->layout()->vudlID = $this->id; $this->layout()->vudlID = $this->id;
$this->layout()->hierarchyID = $this->hierarchyID; $this->layout()->hierarchyID = $this->hierarchyID;
$this->layout()->parents = $this->parents; $this->layout()->parents = $this->parents;
$this->layout()->siblings = $this->siblings; $this->layout()->siblings = $this->siblings;
function json_php_encode($op, $quotes = false) { function json_php_encode($op, $quotes = false) {
if($quotes) { if($quotes) {
return str_replace('"', "'", str_replace("'", "\\'", str_replace('\/', '/', json_encode($op)))); return str_replace('"', "'", str_replace("'", "\\'", str_replace('\/', '/', json_encode($op))));
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
google.load("swfobject", "2.2"); google.load("swfobject", "2.2");
var documentID = '<?=$this->id ?>'; var documentID = '<?=$this->id ?>';
var initPage = $.parseJSON('<?=json_encode($this->outline['lists'][$this->initList][$this->initPage], JSON_HEX_APOS | JSON_HEX_AMP) ?>'); var initPage = $.parseJSON('<?=json_encode($this->outline['lists'][$this->initList][$this->initPage], JSON_HEX_APOS | JSON_HEX_AMP) ?>');
counts = $.parseJSON('<?=json_encode($this->outline['counts'], JSON_HEX_APOS | JSON_HEX_AMP) ?>'); counts = $.parseJSON('<?=json_encode($this->outline['counts'], JSON_HEX_APOS | JSON_HEX_AMP) ?>');
<? if(count($this->outline['lists'][0]) >= $this->outline['counts'][0]): ?> <? if(count($this->outline['lists'][0]) >= $this->outline['counts'][0]): ?>
loading_pages = false; loading_pages = false;
...@@ -123,7 +123,7 @@ ...@@ -123,7 +123,7 @@
<? endforeach; ?> <? endforeach; ?>
<!-- POST LOADING PLACEHOLDERS --> <!-- POST LOADING PLACEHOLDERS -->
<? if(isset($this->outline['counts'][$key])): ?> <? if(isset($this->outline['counts'][$key])): ?>
<? for($i=$this->page+count($list);$i<$this->outline['counts'][$key];$i++): ?> <? for($i=$this->initPage+count($list);$i<$this->outline['counts'][$key];$i++): ?>
<a class="page-link unloaded" id="item<?=($i) ?>" title="<?=$i ?>">Loading...</a> <a class="page-link unloaded" id="item<?=($i) ?>" title="<?=$i ?>">Loading...</a>
<? endfor; ?> <? endfor; ?>
<? endif; ?> <? endif; ?>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment