mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-04 15:09:16 +02:00
Added new feature to settings to resolve GitHub issue 13.
This commit is contained in:
parent
7649612ec5
commit
2bfab9d4a9
5 changed files with 25 additions and 7 deletions
|
@ -138,6 +138,7 @@
|
|||
<input type='radio' name='fontSize' value='medium'><span class='medium'>Medium</span><br>
|
||||
<input type='radio' name='fontSize' value='large'><span class='large'>Large</span><br>
|
||||
<input type='radio' name='fontSize' value='x-large'><span class='xlarge'>Extra Large</span> -->
|
||||
<input type="checkbox" id="sidebarReflow" name="sidebarReflow">Reflow text when sidebars are open.</input>
|
||||
</p>
|
||||
</div>
|
||||
<div class="closer icon-cancel-circled"></div>
|
||||
|
|
|
@ -98,7 +98,9 @@
|
|||
<div class="md-content">
|
||||
<h3>Settings</h3>
|
||||
<div>
|
||||
<p></p>
|
||||
<p>
|
||||
<input type="checkbox" id="sidebarReflow" name="sidebarReflow">Reflow text when sidebars are open.</input>
|
||||
</p>
|
||||
</div>
|
||||
<div class="closer icon-cancel-circled"></div>
|
||||
</div>
|
||||
|
|
|
@ -6,11 +6,19 @@ EPUBJS.reader.ReaderController = function(book) {
|
|||
$prev = $("#prev");
|
||||
|
||||
var slideIn = function() {
|
||||
if (Reader.settings.sidebarReflow){
|
||||
$('#main').removeClass('single');
|
||||
} else {
|
||||
$main.removeClass("closed");
|
||||
}
|
||||
};
|
||||
|
||||
var slideOut = function() {
|
||||
if (Reader.settings.sidebarReflow){
|
||||
$('#main').addClass('single');
|
||||
} else {
|
||||
$main.addClass("closed");
|
||||
}
|
||||
};
|
||||
|
||||
var showLoader = function() {
|
||||
|
|
|
@ -12,6 +12,12 @@ EPUBJS.reader.SettingsController = function() {
|
|||
$settings.removeClass("md-show");
|
||||
};
|
||||
|
||||
var $sidebarReflowSetting = $('#sidebarReflow');
|
||||
|
||||
$sidebarReflowSetting.on('click', function() {
|
||||
Reader.settings.sidebarReflow = !Reader.settings.sidebarReflow;
|
||||
});
|
||||
|
||||
$settings.find(".closer").on("click", function() {
|
||||
hide();
|
||||
});
|
||||
|
|
|
@ -37,7 +37,8 @@ EPUBJS.Reader = function(path, _options) {
|
|||
bookmarks : null,
|
||||
contained : null,
|
||||
bookKey : null,
|
||||
styles : null
|
||||
styles : null,
|
||||
sidebarReflow: false
|
||||
});
|
||||
|
||||
this.setBookKey(path); //-- This could be username + path or any unique string
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue