-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Version warning banner: inject on role="main" or main tag #8079
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,11 +25,14 @@ function init(data) { | |
.attr('href', currentURL) | ||
.text(data.slug); | ||
|
||
var body = $("div.body"); | ||
if (!body.length) { | ||
body = $("div.document"); | ||
var selectors = ['[role=main]', 'main', 'div.body', 'div.document']; | ||
for (var i = 0; i < selectors.length; i += 1) { | ||
Comment on lines
+28
to
+29
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 we should copy these lines to the 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. |
||
var body = $(selectors[i]); | ||
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. Were we ok using 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. FWIW, if we're using let, we should also use it (and const) as much as possible. 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. We should keep it the same as the existing code, to keep things consistent. Then we can change it up when we decide to at the project level. |
||
if (body.length) { | ||
body.prepend(warning); | ||
break; | ||
} | ||
} | ||
body.prepend(warning); | ||
} | ||
|
||
|
||
|
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.
Is this not true anymore?
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.
I put this, but I was wrong, thought we injected this from our extension, but this is just JS from the footer. Well, it wasn't a complete lie, since isn't common in mkdocs themes to have div.body or div.document p: