-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
117 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,30 @@ | ||
if (Meteor.isClient) { | ||
|
||
Meteor.startup(function() { | ||
Session.setDefault('reading-view-panel', null); | ||
Session.setDefault('reading-view-panel-visible', false); | ||
}); | ||
|
||
Template.readingview.get_section = function() { | ||
var id = new Meteor.Collection.ObjectID(Router.current().params._id); | ||
return SectionContents.findOne(id); | ||
} | ||
|
||
Template.readingview.get_panel_visible = function() { | ||
if (Session.get('reading-view-panel-visible')) { | ||
return 'show-panel'; | ||
} else { | ||
return 'hide-panel'; | ||
} | ||
} | ||
|
||
Template.readingview.get_panel_contents = function() { | ||
var panel = Session.get('reading-view-panel'); | ||
if (panel === null) { | ||
return null; | ||
} | ||
|
||
return Template[panel]; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,45 @@ | ||
@import 'palette'; | ||
|
||
.content { | ||
margin: 1em 25%; | ||
.show-panel { | ||
#side-panel-wrap { | ||
width: 25%; | ||
} | ||
|
||
#content-wrap { | ||
width: 75%; | ||
} | ||
} | ||
|
||
.hide-panel { | ||
#side-panel-wrap { | ||
width: 0%; | ||
} | ||
|
||
#content-wrap { | ||
width: 100%; | ||
} | ||
} | ||
|
||
#panel-selector { | ||
font-size: 0em; | ||
|
||
#side-panel-wrap { | ||
vertical-align: top; | ||
overflow: hidden; | ||
|
||
#side-panel-content { | ||
min-width: 25%; | ||
} | ||
} | ||
|
||
#side-panel-wrap, #content-wrap { | ||
font-size: 1rem; | ||
display: inline-block; | ||
transition: width 1s ease; | ||
} | ||
} | ||
|
||
#content { | ||
width: 75%; | ||
margin: 1em auto; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,33 @@ | ||
<!-- READING VIEW --> | ||
|
||
<template name="readingview"> | ||
<div class="content"> | ||
{{#with get_section }} | ||
{{{ html }}} | ||
{{/with}} | ||
<div id="panel-selector" class="{{get_panel_visible}}"> | ||
<div id="side-panel-wrap"> | ||
<div id="side-panel-content"> | ||
{{> get_panel_contents}} | ||
</div> | ||
</div> | ||
<div id="content-wrap"> | ||
<div id="content"> | ||
{{#with get_section }} | ||
{{{ html }}} | ||
{{/with}} | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<template name="table_of_contents_panel"> | ||
ToC placeholder<br /> | ||
ToC placeholder<br /> | ||
</template> | ||
|
||
<template name="annotation_list_panel"> | ||
annotations placeholder<br /> | ||
annotations placeholder<br /> | ||
</template> | ||
|
||
<template name="type_panel"> | ||
type placeholder<br /> | ||
type placeholder<br /> | ||
</template> |