MCPcopy Create free account
hub / github.com/cryptii/cryptii / refresh

Method refresh

src/View.js:83–105  ·  view source on GitHub ↗

* Rerenders the view. * @return {View} Fluent interface

()

Source from the content-addressed store, hash-verified

81 * @return {View} Fluent interface
82 */
83 refresh () {
84 const $oldRoot = this._$root
85 if ($oldRoot === null) {
86 // only refresh if there is an existing element
87 return this
88 }
89
90 // render
91 this._$root = null
92 this.willRender()
93 this._$root = this.render()
94 this.didRender()
95
96 // append each subview to new root element
97 this.getSubviews().forEach(this.appendSubviewElement)
98
99 // replace root node in dom
100 if ($oldRoot && $oldRoot.parentNode) {
101 $oldRoot.parentNode.replaceChild(this._$root, $oldRoot)
102 }
103
104 return this
105 }
106
107 /**
108 * Renders the view.

Callers 4

clearFilterMethod · 0.80
applyFilterMethod · 0.80
setStyleMethod · 0.80
setElementsMethod · 0.80

Calls 4

willRenderMethod · 0.95
renderMethod · 0.95
didRenderMethod · 0.95
getSubviewsMethod · 0.95

Tested by

no test coverage detected