Minor: coding conventions and javascript, also added submenu title

This commit is contained in:
martimiz 2012-11-09 12:36:46 +01:00 committed by Will Rossiter
parent 08bfb941d4
commit 1f6c5deda7
2 changed files with 19 additions and 17 deletions

View File

@ -40,50 +40,50 @@ class DocumentationPage extends ViewableData {
/** /**
* @var Boolean * @var Boolean
*/ */
protected $IsFolder = false; protected $isFolder = false;
/** /**
* @param Boolean * @param Boolean
*/ */
function setIsFolder($isFolder = false) { public function setIsFolder($isFolder = false) {
$this->IsFolder = $isFolder; $this->IsFolder = $isFolder;
} }
/** /**
* @return Boolean * @return Boolean
*/ */
function getIsFolder($isFolder = false) { public function getIsFolder($isFolder = false) {
return $this->IsFolder; return $this->IsFolder;
} }
/** /**
* @return DocumentationEntity * @return DocumentationEntity
*/ */
function getEntity() { public function getEntity() {
return $this->entity; return $this->entity;
} }
/** /**
* @param DocumentationEntity * @param DocumentationEntity
*/ */
function setEntity($entity) { public function setEntity($entity) {
$this->entity = $entity; $this->entity = $entity;
} }
/** /**
* @return string * @return string
*/ */
function getRelativePath() { public function getRelativePath() {
return $this->relativePath; return $this->relativePath;
} }
/** /**
* @param string * @param string
*/ */
function setRelativePath($path) { public function setRelativePath($path) {
$this->relativePath = $path; $this->relativePath = $path;
} }
/** /**
* @return string * @return string
*/ */

View File

@ -8,8 +8,8 @@
*/ */
if($("#content-column").length > 0) { if($("#content-column").length > 0) {
var toc = '<div id="table-of-contents" class="open">' + var toc = '<div id="table-of-contents" class="open">' +
'<h4>Table of contents<span class="updown">&#9660;</span></h4><ul id="toc" style="display:none;">'; '<h4>Table of contents<span class="updown">&#9660;</span></h4><ul style="display: none;">';
// Remove existing anchor redirection in the url // Remove existing anchor redirection in the url
var pageURL = window.location.href.replace(/#[a-zA-Z0-9\-\_]*/g, ''); var pageURL = window.location.href.replace(/#[a-zA-Z0-9\-\_]*/g, '');
@ -39,10 +39,10 @@
// Toggle the TOC // Toggle the TOC
$('#table-of-contents').attr('href', 'javascript:void()').toggle( $('#table-of-contents').attr('href', 'javascript:void()').toggle(
function() { function() {
$("#toc").animate({'height':'show'}, 200, function(){$('#table-of-contents h4 span').html('&#9650;');}) $("#table-of-contents ul").animate({'height':'show'}, 200, function(){$('#table-of-contents h4 span').html('&#9650;');})
}, },
function() { function() {
$("#toc").animate({'height':'hide'}, 200, function(){$('#table-of-contents h4 span').html('&#9660;');}) $("#table-of-contents ul").animate({'height':'hide'}, 200, function(){$('#table-of-contents h4 span').html('&#9660;');})
} }
); );
@ -57,8 +57,10 @@
* move to separate menu block * move to separate menu block
*/ */
if ($("#submenu").length > 0) { if ($("#submenu").length > 0) {
var submenu = '<div class = "sidebar-box"><ul>'; var submenuTitle = $("#sibling-pages").find('a.current, a.section').eq(0).text();
var submenu = '<div class = "sidebar-box"><h4>' + submenuTitle + '</h4><ul>'
submenu += $("#submenu").html(); submenu += $("#submenu").html();
submenu += '</ul></div>';
$("#sidebar-column").append(submenu); $("#sidebar-column").append(submenu);
$("#submenu").remove(); $("#submenu").remove();
} }