MCPcopy Create free account
hub / github.com/breck7/scroll / addClassToStumpParticle

Method addClassToStumpParticle

external/.scrollLibs.js:22807–22817  ·  view source on GitHub ↗
(className)

Source from the content-addressed store, hash-verified

22805 return this.topDownArray.find(particle => particle._getUid() === guid)
22806 }
22807 addClassToStumpParticle(className) {
22808 const classParser = this.touchParticle("class")
22809 const atoms = classParser.getAtomsFrom(1)
22810 // note: we call add on shadow regardless, because at the moment stump may have gotten out of
22811 // sync with shadow, if things modified the dom. todo: cleanup.
22812 this.getShadow().addClassToShadow(className)
22813 if (atoms.includes(className)) return this
22814 atoms.push(className)
22815 classParser.setContent(atoms.join(this.atomBreakSymbol))
22816 return this
22817 }
22818 removeClassFromStumpParticle(className) {
22819 const classParser = this.getParticle("class")
22820 if (!classParser) return this

Callers 1

dragoverHandlerMethod · 0.80

Calls 6

getShadowMethod · 0.95
touchParticleMethod · 0.80
getAtomsFromMethod · 0.80
setContentMethod · 0.80
addClassToShadowMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected