mirror of
https://github.com/opencv/opencv.git
synced 2024-11-23 18:50:21 +08:00
Merge pull request #26340 from Kumataro:wa26339
doc: fix the position of toggle button #26340 Close #26339 ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work - [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [ ] The feature is well documented and sample code can be built with the project CMake
This commit is contained in:
parent
94d5ad09ff
commit
4398e0b62b
@ -72,12 +72,23 @@ function buttonsToAdd($elements, $heading, $type) {
|
||||
}
|
||||
|
||||
function addTutorialsButtons() {
|
||||
$("h1").each(function() {
|
||||
var $elements = $(this).nextUntil("h1")
|
||||
// See https://github.com/opencv/opencv/issues/26339
|
||||
$lastHeader = undefined
|
||||
$("h1,h2,h3,div.newInnerHTML").each(function() {
|
||||
if( this.tagName.startsWith("H") ) {
|
||||
$lastHeader = $(this)
|
||||
return true // loop-continue
|
||||
}
|
||||
if( $lastHeader === undefined ) {
|
||||
return true // loop-continue
|
||||
}
|
||||
var $toggleHeader = $lastHeader.tagName
|
||||
var $elements = $lastHeader.nextUntil($toggleHeader)
|
||||
var $lower = $elements.find("div.newInnerHTML")
|
||||
$elements = $elements.add($lower)
|
||||
$elements = $elements.filter("div.newInnerHTML")
|
||||
buttonsToAdd($elements, $(this), "h1")
|
||||
buttonsToAdd($elements, $lastHeader, $toggleHeader)
|
||||
$lastHeader = undefined
|
||||
});
|
||||
$(".toggleable_button").first().click();
|
||||
var $clickDefault = $('.toggleable_button.label_python').first();
|
||||
|
Loading…
Reference in New Issue
Block a user