MCPcopy
hub / github.com/iChochy/NCE / bindWindowEvents

Method bindWindowEvents

js/ReadingSystem.js:1127–1133  ·  view source on GitHub ↗

* 绑定窗口事件

()

Source from the content-addressed store, hash-verified

1125 * 绑定窗口事件
1126 */
1127 bindWindowEvents() {
1128 on(window, 'hashchange', () => {
1129 const newKey = location.hash.slice(1).trim() || this.config.DEFAULT_BOOK_KEY;
1130 if (newKey === this.state.bookKey) return;
1131 this.applyBookChange(newKey).then(() => this.loadUnitFromStorage());
1132 });
1133 }
1134
1135 // =========================================================================
1136 // 清理和销毁

Callers 1

bindAllEventsMethod · 0.95

Calls 3

applyBookChangeMethod · 0.95
loadUnitFromStorageMethod · 0.95
onFunction · 0.90

Tested by

no test coverage detected