MCPcopy Index your code
hub / github.com/codecombat/codecombat / afterRender

Method afterRender

app/views/modal/ModelModal.js:43–68  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

41 }
42
43 afterRender () {
44 if (!this.supermodel.finished()) { return }
45 this.modelTreemas = {}
46 return (() => {
47 const result = []
48 for (const model of Array.from(this.models != null ? this.models : [])) {
49 const data = $.extend(true, {}, model.attributes)
50 const schema = $.extend(true, {}, model.schema())
51 const treemaOptions = {
52 schema,
53 data,
54 readOnly: false
55 }
56 const modelTreema = this.$el.find(`.model-treema[data-model-id='${model.id}']`).treema(treemaOptions)
57 if (modelTreema != null) {
58 modelTreema.build()
59 }
60 if (modelTreema != null) {
61 modelTreema.open()
62 }
63 this.openTastyTreemas(modelTreema, model)
64 result.push(this.modelTreemas[model.id] = modelTreema)
65 }
66 return result
67 })()
68 }
69
70 openTastyTreemas (modelTreema, model) {
71 // To save on quick inspection, let's auto-open the properties we're most likely to want to see.

Callers

nothing calls this directly

Calls 3

openTastyTreemasMethod · 0.95
schemaMethod · 0.80
openMethod · 0.45

Tested by

no test coverage detected