mirror of
https://github.com/silverstripe/silverstripe-docsviewer
synced 2024-10-22 11:05:56 +02:00
Minor: coding conventions and javascript, also added submenu title
This commit is contained in:
parent
08bfb941d4
commit
1f6c5deda7
@ -40,50 +40,50 @@ class DocumentationPage extends ViewableData {
|
||||
/**
|
||||
* @var Boolean
|
||||
*/
|
||||
protected $IsFolder = false;
|
||||
protected $isFolder = false;
|
||||
|
||||
/**
|
||||
* @param Boolean
|
||||
*/
|
||||
function setIsFolder($isFolder = false) {
|
||||
public function setIsFolder($isFolder = false) {
|
||||
$this->IsFolder = $isFolder;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Boolean
|
||||
*/
|
||||
function getIsFolder($isFolder = false) {
|
||||
public function getIsFolder($isFolder = false) {
|
||||
return $this->IsFolder;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return DocumentationEntity
|
||||
*/
|
||||
function getEntity() {
|
||||
public function getEntity() {
|
||||
return $this->entity;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param DocumentationEntity
|
||||
*/
|
||||
function setEntity($entity) {
|
||||
public function setEntity($entity) {
|
||||
$this->entity = $entity;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
function getRelativePath() {
|
||||
public function getRelativePath() {
|
||||
return $this->relativePath;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string
|
||||
*/
|
||||
function setRelativePath($path) {
|
||||
public function setRelativePath($path) {
|
||||
$this->relativePath = $path;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
|
@ -8,8 +8,8 @@
|
||||
*/
|
||||
if($("#content-column").length > 0) {
|
||||
var toc = '<div id="table-of-contents" class="open">' +
|
||||
'<h4>Table of contents<span class="updown">▼</span></h4><ul id="toc" style="display:none;">';
|
||||
|
||||
'<h4>Table of contents<span class="updown">▼</span></h4><ul style="display: none;">';
|
||||
|
||||
// Remove existing anchor redirection in the url
|
||||
var pageURL = window.location.href.replace(/#[a-zA-Z0-9\-\_]*/g, '');
|
||||
|
||||
@ -39,10 +39,10 @@
|
||||
// Toggle the TOC
|
||||
$('#table-of-contents').attr('href', 'javascript:void()').toggle(
|
||||
function() {
|
||||
$("#toc").animate({'height':'show'}, 200, function(){$('#table-of-contents h4 span').html('▲');})
|
||||
$("#table-of-contents ul").animate({'height':'show'}, 200, function(){$('#table-of-contents h4 span').html('▲');})
|
||||
},
|
||||
function() {
|
||||
$("#toc").animate({'height':'hide'}, 200, function(){$('#table-of-contents h4 span').html('▼');})
|
||||
$("#table-of-contents ul").animate({'height':'hide'}, 200, function(){$('#table-of-contents h4 span').html('▼');})
|
||||
}
|
||||
);
|
||||
|
||||
@ -57,8 +57,10 @@
|
||||
* move to separate menu block
|
||||
*/
|
||||
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 += '</ul></div>';
|
||||
$("#sidebar-column").append(submenu);
|
||||
$("#submenu").remove();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user