()
| 35 | } |
| 36 | |
| 37 | makeNewModel () { |
| 38 | const model = new this.modelClass() |
| 39 | const name = this.$el.find('#name').val() |
| 40 | |
| 41 | if (!this.hasNoNameProperty) { |
| 42 | model.set('name', name) |
| 43 | } |
| 44 | if (this.modelClass.name === 'Level') { |
| 45 | model.set('tasks', this.modelClass.schema.default.tasks) |
| 46 | } |
| 47 | if (model.schema().properties.permissions) { |
| 48 | model.set('permissions', [{ access: 'owner', target: me.id }]) |
| 49 | } |
| 50 | if (this.properties != null) { for (const key in this.properties) { const prop = this.properties[key]; model.set(key, prop) } } |
| 51 | return model |
| 52 | } |
| 53 | |
| 54 | onModelSubmitted (e) { |
| 55 | e.preventDefault() |
no test coverage detected