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

Method bindBookSelects

js/ReadingSystem.js:904–915  ·  view source on GitHub ↗

* 绑定课本选择事件

()

Source from the content-addressed store, hash-verified

902 * 绑定课本选择事件
903 */
904 bindBookSelects() {
905 if (this.bindingFlags.bookSelects || !this.dom.bookSelects.length) return;
906 this.bindingFlags.bookSelects = true;
907
908 this.dom.bookSelects.forEach((select) => {
909 on(select, 'change', (event) => {
910 if (!event.target.value) return;
911 if (location.hash.slice(1) === event.target.value) return;
912 location.hash = event.target.value;
913 });
914 });
915 }
916
917 /**
918 * 绑定单元列表事件

Callers 1

bindAllEventsMethod · 0.95

Calls 1

onFunction · 0.90

Tested by

no test coverage detected