|
93 | 93 | {%- endif -%} |
94 | 94 |
|
95 | 95 | <script type="text/javascript"> |
96 | | - $('#sideBarCnt').css({'width': $('.sideBar').width() + 'px'}) |
97 | | - $('.container .head').css({'width': $('.docContainer').width() + 'px'}) |
98 | | - |
99 | | - $(window).resize(function() { |
100 | | - $('#sideBarCnt').css({'width': $('.sideBar').width() + 'px'}) |
101 | | - $('.container .head').css({'width': $('.docContainer').width() + 'px'}) |
102 | | - realFunc() |
103 | | - }) |
104 | | - |
105 | | - window.addEventListener('scroll', realFunc); |
106 | | - |
107 | | - function realFunc(){ |
108 | | - var sd = $(window).scrollTop(); |
109 | | - var dcheight = $('.docContainer').height() + 65 - sd |
110 | | - if (breakpoint() == 'lg') { |
111 | | - if (sd > 65 && dcheight>0) { |
112 | | - if (!$('.subHeadWrapper').hasClass('shw-fixed')) { |
113 | | - $('.subHeadWrapper').addClass('shw-fixed') |
114 | | - $('.docContainer').addClass('dc-fixed') |
115 | | - $('#sideBarCnt').addClass('ftm-fixed') |
116 | | - $('.rightSideMenu').addClass('rsm-fixed') |
117 | | - $('#docHead').addClass('ch-fixed') |
118 | | - } |
119 | | - if (dcheight > document.body.clientHeight) { |
120 | | - $('#sideBarCnt.ftm-fixed').css({'height': 'calc(100vh - 170px)'}) |
121 | | - $('.rightSideMenu.rsm-fixed').css({'height': 'calc(100vh - 170px)'}) |
122 | | - } else { |
123 | | - $('#sideBarCnt.ftm-fixed').css({'height': (dcheight - 40) + 'px'}) |
124 | | - $('.rightSideMenu.rsm-fixed').css({'height': (dcheight - 40) + 'px'}) |
125 | | - } |
126 | | - $('.markdown-body').css({'margin-top': (100 + $('.container .head').height()) + 'px'}) |
127 | | - } else { |
128 | | - $('.subHeadWrapper').removeClass('shw-fixed') |
129 | | - $('.docContainer').removeClass('dc-fixed') |
130 | | - $('#sideBarCnt').removeClass('ftm-fixed') |
131 | | - $('.rightSideMenu').removeClass('rsm-fixed') |
132 | | - $('.container .head').removeClass('ch-fixed') |
133 | | - $('.markdown-body').css({'margin-top': '40px'}) |
134 | | - } |
135 | | - } |
136 | | - if (breakpoint() == 'md') { |
137 | | - if (sd > 65 && dcheight > 0) { |
138 | | - if (!$('.subHeadWrapper').hasClass('shw-fixed')) { |
139 | | - $('.subHeadWrapper').addClass('shw-fixed') |
140 | | - $('.docContainer').addClass('dc-fixed') |
141 | | - $('#sideBarCnt').addClass('ftm-fixed') |
142 | | - $('#docHead').addClass('ch-fixed') |
143 | | - } |
144 | | - $('.markdown-body').css({'margin-top': (100 + $('.container .head').height()) + 'px'}) |
145 | | - } else { |
146 | | - $('.subHeadWrapper').removeClass('shw-fixed') |
147 | | - $('.docContainer').removeClass('dc-fixed') |
148 | | - $('#sideBarCnt').removeClass('ftm-fixed') |
149 | | - $('#docHead').removeClass('ch-fixed') |
150 | | - $('.markdown-body').css({'margin-top': '40px'}) |
151 | | - } |
152 | | - } |
153 | | - } |
154 | | - |
155 | | - $('.sideBarIcon').click(function() { |
156 | | - $(".sideBar").toggleClass('hide-sm'); |
157 | | - $(".sideBar").toggleClass('hide-xs'); |
158 | | - setTimeout(function() { |
159 | | - console.log('sidebar' + $('.sideBar').width()) |
160 | | - $('#sideBarCnt').css({'width': $('.sideBar').width() + 'px'}) |
161 | | - }, 100) |
162 | | - }) |
163 | | - |
164 | | - let timeInt = setInterval(function() { |
165 | | - var container = $('#sideBarCnt'), scrollTo = $('#sideBarCnt .activeLink'); |
166 | | - console.log(scrollTo) |
167 | | - if (scrollTo.length>0) { |
168 | | - container.scrollTop( |
169 | | - scrollTo.offset().top - container.offset().top + container.scrollTop() |
170 | | - ); |
171 | | - clearInterval(timeInt) |
172 | | - } |
173 | | - }, 500) |
174 | | - |
175 | | - function onSearchFinish(e) { |
176 | | - var evt = window.event || e; |
177 | | - if (evt.keyCode == 13) { |
178 | | - |
179 | | - } |
180 | | - } |
181 | | - |
182 | 96 | $('#txtSearch').keydown(function(e) { |
183 | 97 | if (e.keyCode == 13) { |
184 | 98 | window.location.href = '/web-twain/docs/search.html?q=' + $('#txtSearch').val() |
185 | 99 | } |
186 | 100 | }) |
187 | | - |
188 | 101 | </script> |
189 | 102 |
|
190 | 103 | {%- include livehelp.html -%} |
|
0 commit comments