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

Method onClickSaveButton

app/views/editor/chat/ChatEditView.js:94–120  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

92 }
93
94 onClickSaveButton (e) {
95 this.treema.endExistingEdits()
96 for (const key in this.treema.data) {
97 const value = this.treema.data[key]
98 this.chat.set(key, value)
99 }
100
101 // Store chat.message.originalText iff the current text is different than the original
102 const message = this.chat.get('message')
103 if ((message.text !== this.originalMessageText) && (message.originalText !== this.originalMessageText)) {
104 message.originalText = this.originalMessageText
105 this.chat.set('message', message)
106 }
107
108 this.chat.updateI18NCoverage()
109
110 const res = this.chat.save()
111
112 res.error((collection, response, options) => {
113 return console.error(response)
114 })
115
116 return res.success(() => {
117 const url = `/editor/chat/${this.chat.get('slug') || this.chat.id}`
118 return document.location.href = url
119 })
120 }
121
122 confirmDeletion () {
123 const renderData = {

Callers

nothing calls this directly

Calls 6

setMethod · 0.45
getMethod · 0.45
updateI18NCoverageMethod · 0.45
saveMethod · 0.45
errorMethod · 0.45
successMethod · 0.45

Tested by

no test coverage detected