-
Notifications
You must be signed in to change notification settings - Fork 806
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[toc2] update for cells width ans sidebar height #994
Merged
Merged
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
3232367
[toc2] Improve sidebar toggle transition
jfbercher 6a3c37f
[toc2] Restore cells to original width, see #993
jfbercher 1dfafa6
[toc2] Restore cells to original width, see #993, following @jcb91
jfbercher 3245587
[toc2] Recompute sideBar height on window resize
jfbercher 521f86c
[toc2] Remove extra cell styling and a useless parameter
jfbercher File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -165,8 +165,9 @@ var make_link = function(h, num_lbl) { | |
callback && callback(); | ||
} | ||
|
||
function setNotebookWidth(cfg, st) { | ||
//cfg.widenNotebook = false; | ||
function setNotebookWidth(cfg, st, sideBarIsToggling) { | ||
//cfg.widenNotebook = true; | ||
var sideBarIsToggling = typeof sideBarIsToggling !== 'undefined' ? sideBarIsToggling : false; | ||
if (cfg.sideBar) { | ||
if ($('#toc-wrapper').is(':visible')) { | ||
$('#notebook-container').css('margin-left', $('#toc-wrapper').width() + 30) | ||
|
@@ -176,15 +177,15 @@ var make_link = function(h, num_lbl) { | |
$('#notebook-container').css('margin-left', 30); | ||
$('#notebook-container').css('width', $('#notebook').width() - 30); | ||
} else { // original width | ||
$("#notebook-container").css({'width':"82%", 'margin-left':'auto'}) | ||
$("#notebook-container").css({'width':st.nbcontainer_width, 'margin-left':'auto'}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this should probably set an empty string, to not set anything, otherwise it'll break when the window is resized. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, you are right. thanks |
||
} | ||
} | ||
} else { | ||
if (cfg.widenNotebook) { | ||
$('#notebook-container').css('margin-left', 30); | ||
$('#notebook-container').css('width', $('#notebook').width() - 30); | ||
} else { // original width | ||
$("#notebook-container").css({'width':"82%", 'margin-left':'auto'}) | ||
$("#notebook-container").css({'width':st.nbcontainer_width, 'margin-left':'auto'}) | ||
} | ||
} | ||
} | ||
|
@@ -649,7 +650,7 @@ var table_of_contents = function (cfg,st) { | |
//$("#toc-wrapper").toggle({'complete':function(){ | ||
$("#toc-wrapper").toggle({ | ||
'progress':function(){ | ||
setNotebookWidth(cfg,st); | ||
setNotebookWidth(cfg,st, true); | ||
}, | ||
'complete': function(){ | ||
if(liveNotebook){ | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this
sideBarIsToggling
variable doesn't actually seem to get used anywhere - what is it intended for?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing. Indeed it is a dead code from a previous attempt. I remove it.