MCPcopy Create free account
hub / github.com/FSGModding/FSG_Mod_Assistant / modClick

Method modClick

renderer/renderJS/main_ui_lib.js:813–845  ·  view source on GitHub ↗
(e, id)

Source from the content-addressed store, hash-verified

811 }
812
813 modClick(e, id) {
814 if ( e.altKey ) {
815 this.track.altClick = id
816 this.doSideBar()
817 return
818 }
819
820 this.track.altClick = null
821
822 const thisRow = e.target.closest('.mod-row')
823 const theTable = thisRow.closest('table')
824 const thisIndex = [...theTable.children].indexOf(thisRow)
825
826 if ( !e.shiftKey || this.track.lastIndex === null || thisIndex === this.track.lastIndex ) {
827 this.track.lastIndex = thisIndex
828 this.track.lastID = id
829 this.modToggle(id)
830 this.doSideBar()
831 return
832 }
833
834 const shiftOn = this.track.selected.has(this.track.lastID)
835 const index_start = Math.min(thisIndex, this.track.lastIndex)
836 const index_end = Math.max(thisIndex, this.track.lastIndex)
837
838 for ( let i = index_start; i <= index_end; i++ ) {
839 this.modToggle(theTable.children[i].id, shiftOn)
840 }
841
842 this.track.lastIndex = thisIndex
843 this.track.lastID = id
844 this.doSideBar()
845 }
846
847 modToggle(id, force = null) {
848 let doAdd = !this.track.selected.has(id)

Callers 1

#addModMethod · 0.95

Calls 3

doSideBarMethod · 0.95
modToggleMethod · 0.95
hasMethod · 0.80

Tested by

no test coverage detected