Merge pull request #1091 from fkjogu/master

Fix wrong width when cfg.widenNotebook is disabled
This commit is contained in:
Josh Barnes
2017-10-04 10:49:12 +01:00
committed by GitHub
2 changed files with 16 additions and 4 deletions
+5 -1
View File
@@ -24,11 +24,15 @@ which makes it much easier to fill in each release's changelog :)
New features and bugfixes:
- `toc2`
* [#1084](https://github.com/ipython-contrib/pulls/1084)
* [#1084](https://github.com/ipython-contrib/jupyter_contrib_nbextensions/pull/1084)
[@jfbercher](https://github.com/jfbercher)
fix for
[#1083](https://github.com/ipython-contrib/issue/1083):
Revert full url in links to relative to the current page.
* [#1091](https://github.com/ipython-contrib/jupyter_contrib_nbextensions/pull/1091)
[@fkoessel](https://github.com/fkoessel)
Notebook is not widened if sidebar is displayed and `cfg.widenNotebook` is
unchecked.
0.3.1
@@ -155,11 +155,19 @@
}
function setNotebookWidth(cfg, st) {
//cfg.widenNotebook = true;
if (cfg.sideBar) {
if ($('#toc-wrapper').is(':visible')) {
$('#notebook-container').css('margin-left', $('#toc-wrapper').width() + 30)
$('#notebook-container').css('width', $('#notebook').width() - $('#toc-wrapper').width() - 30)
if (cfg.widenNotebook) {
$('#notebook-container').css('margin-left', $('#toc-wrapper').width() + 30)
$('#notebook-container').css('width', $('#notebook').width() - $('#toc-wrapper').width() - 30)
} else {
var space_needed = $('#toc-wrapper').width() + 30 +
$('#notebook-container').width() - $('#notebook').width();
if (space_needed > 0) {
$('#notebook-container').css('margin-left', $('#toc-wrapper').width() + 30)
$('#notebook-container').css('width', $('#notebook-container').width() - space_needed)
}
}
} else {
if (cfg.widenNotebook) {
$('#notebook-container').css('margin-left', 30);