Skip to content

Commit 94dcf23

Browse files
update to internal commit 132df02a
1 parent 6eb2f7f commit 94dcf23

File tree

1 file changed

+24
-72
lines changed

1 file changed

+24
-72
lines changed

_layouts/search-page.html

Lines changed: 24 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -143,22 +143,6 @@ <h1>Search</h1>
143143
integrity="sha256-lZaRhKri35AyJSypXXs4o6OPFTbTmUoltBbDCbdzegg=" crossorigin="anonymous"></script>
144144
<script>anchors.add();</script>
145145

146-
{%- if page.needAutoGenerateSidebar -%}
147-
{%- unless page.needGenerateH3Content -%}
148-
<script>
149-
FullTreeMenuList(true, false);
150-
</script>
151-
{%- else -%}
152-
<script>
153-
FullTreeMenuList(true);
154-
</script>
155-
{%- endunless -%}
156-
{%- else -%}
157-
<script>
158-
FullTreeMenuList(false);
159-
</script>
160-
{%- endif -%}
161-
162146
<script type="text/javascript">
163147
$('#sideBarCnt').css({'width': $('.sideBar').width() + 'px'})
164148
$('.container .head').css({'width': $('.docContainer').width() + 'px'})
@@ -171,62 +155,30 @@ <h1>Search</h1>
171155

172156
window.addEventListener('scroll', realFunc);
173157

174-
function realFunc(){
175-
var sd = $(window).scrollTop();
176-
var dcheight = $('.docContainer').height() + 65 - sd
177-
if (breakpoint() == 'lg') {
178-
if (sd > 65 && dcheight>0) {
179-
if (!$('.subHeadWrapper').hasClass('shw-fixed')) {
180-
$('.subHeadWrapper').addClass('shw-fixed')
181-
$('.docContainer').addClass('dc-fixed')
182-
$('#sideBarCnt').addClass('ftm-fixed')
183-
$('.rightSideMenu').addClass('rsm-fixed')
184-
$('#docHead').addClass('ch-fixed')
185-
}
186-
if (dcheight > document.body.clientHeight) {
187-
$('#sideBarCnt.ftm-fixed').css({'height': 'calc(100vh - 170px)'})
188-
$('.rightSideMenu.rsm-fixed').css({'height': 'calc(100vh - 170px)'})
189-
} else {
190-
$('#sideBarCnt.ftm-fixed').css({'height': (dcheight - 40) + 'px'})
191-
$('.rightSideMenu.rsm-fixed').css({'height': (dcheight - 40) + 'px'})
192-
}
193-
$('.markdown-body').css({'margin-top': (100 + $('.container .head').height()) + 'px'})
194-
} else {
195-
$('.subHeadWrapper').removeClass('shw-fixed')
196-
$('.docContainer').removeClass('dc-fixed')
197-
$('#sideBarCnt').removeClass('ftm-fixed')
198-
$('.rightSideMenu').removeClass('rsm-fixed')
199-
$('.container .head').removeClass('ch-fixed')
200-
$('.markdown-body').css({'margin-top': '40px'})
201-
}
202-
}
203-
if (breakpoint() == 'md') {
204-
if (sd > 65 && dcheight > 0) {
205-
if (!$('.subHeadWrapper').hasClass('shw-fixed')) {
206-
$('.subHeadWrapper').addClass('shw-fixed')
207-
$('.docContainer').addClass('dc-fixed')
208-
$('#sideBarCnt').addClass('ftm-fixed')
209-
$('#docHead').addClass('ch-fixed')
210-
}
211-
$('.markdown-body').css({'margin-top': (100 + $('.container .head').height()) + 'px'})
212-
} else {
213-
$('.subHeadWrapper').removeClass('shw-fixed')
214-
$('.docContainer').removeClass('dc-fixed')
215-
$('#sideBarCnt').removeClass('ftm-fixed')
216-
$('#docHead').removeClass('ch-fixed')
217-
$('.markdown-body').css({'margin-top': '40px'})
218-
}
219-
}
220-
}
221-
222-
$('.sideBarIcon').click(function() {
223-
$(".sideBar").toggleClass('hide-sm');
224-
$(".sideBar").toggleClass('hide-xs');
225-
setTimeout(function() {
226-
$('#sideBarCnt').css({'width': $('.sideBar').width() + 'px'})
227-
}, 100)
228-
})
229-
158+
function realFunc() {
159+
if (breakpoint() == 'lg') {
160+
var sd = $(window).scrollTop();
161+
if (sd > $('#dynamsoft-header').height()) {
162+
// head and sidebar fixed
163+
if ($('.subHeadWrapper').length > 0) {
164+
$('.subHeadWrapper').css({'top': '0px'});
165+
} else if ($('.productMenu').length > 0) {
166+
$('.productMenu').css({'top': '0px'});
167+
}
168+
} else {
169+
// head and sidebar fixed
170+
if ($('.subHeadWrapper').length > 0) {
171+
$('.subHeadWrapper').css({'top': ($('#dynamsoft-header').height()-sd) + 'px'});
172+
} else if ($('.productMenu').length > 0) {
173+
$('.productMenu').css({'top': ($('#dynamsoft-header').height()-sd) + 'px'});
174+
}
175+
}
176+
} else {
177+
$('.subHeadWrapper').css({'top': 'unset'});
178+
$('.productMenu').css({'top': 'unset'});
179+
}
180+
}
181+
230182
$("body").delegate("#searchResult .gsc-resultsRoot a.gs-title", "click", function(e) {
231183
e.preventDefault();
232184

0 commit comments

Comments
 (0)