MCPcopy Index your code
hub / github.com/zxlie/FeHelper / _applyToolbarDisplayState

Function _applyToolbarDisplayState

apps/json-format/content-script.js:187–212  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

185 };
186
187 let _applyToolbarDisplayState = () => {
188 let toolbar = document.querySelector('#jfToolbar');
189 if (!toolbar) {
190 return;
191 }
192
193 showToolBar = !!formatOptions.JSON_TOOL_BAR_ALWAYS_SHOW;
194 toolbar.classList.toggle('t-collapse', !showToolBar);
195 $('.fe-feedback #toggleBtn .fh-toggle-label').text(showToolBar ? '收起' : '展开');
196 $('.fe-feedback #toggleBtn').attr('aria-expanded', showToolBar ? 'true' : 'false');
197 $('.fe-feedback #toggleBtn').attr('title', showToolBar ? '收起工具栏' : '展开工具栏');
198 $('.fe-feedback .fh-collapse-icon').attr('title', showToolBar ? '收起工具栏' : '展开工具栏');
199 $('.fe-feedback .fh-collapse-icon').attr('aria-label', showToolBar ? '收起工具栏' : '展开工具栏');
200 $('#jfToolbar input[name="alwaysShowToolbar"]').prop('checked', showToolBar);
201
202 _bindToolbarCollapseBehavior();
203 if (showToolBar) {
204 clearTimeout(toolbarCollapseAutoTuckTimer);
205 toolbar.dataset.fhJsonToolbarTucked = '0';
206 toolbar.setAttribute('aria-expanded', 'true');
207 toolbar.style.transform = '';
208 } else {
209 _setToolbarTucked(false);
210 _scheduleToolbarAutoTuck(1500);
211 }
212 };
213
214 let _isOmniMode = () => _getResolvedUiMode() === 'omni';
215

Callers 2

applyPanelOptionsFunction · 0.85
_initToolbarFunction · 0.85

Calls 4

_setToolbarTuckedFunction · 0.85
_scheduleToolbarAutoTuckFunction · 0.85
$Function · 0.50

Tested by

no test coverage detected