mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-23 23:58:02 -05:00
Fixed #715, and some misc cleanup.
This commit is contained in:
parent
7ddd84248b
commit
91c2f0fa33
4 changed files with 7 additions and 11 deletions
|
@ -11,6 +11,3 @@ block modal-body-content
|
|||
| #{model.type()}: #{model.get('name')}
|
||||
td
|
||||
button(value=model.id, data-i18n="editor.revert") Revert
|
||||
|
||||
block modal-footer-content
|
||||
button.btn(data-dismiss="modal", data-i18n="common.cancel") Cancel
|
|
@ -159,11 +159,12 @@ class LevelSystemNode extends TreemaObjectNode
|
|||
name = "#{@system.get('name')} v#{@system.get('version').major}"
|
||||
@buildValueForDisplaySimply valEl, "#{name}"
|
||||
|
||||
onEnterPressed: ->
|
||||
onEnterPressed: (e) ->
|
||||
super e
|
||||
Backbone.Mediator.publish 'edit-level-system', original: @data.original, majorVersion: @data.majorVersion
|
||||
|
||||
open: ->
|
||||
super()
|
||||
open: (depth) ->
|
||||
super depth
|
||||
cTreema = @childrenTreemas.config
|
||||
if cTreema? and (cTreema.getChildren().length or cTreema.canAddChild())
|
||||
cTreema.open()
|
||||
|
|
|
@ -210,7 +210,6 @@ module.exports = class CocoView extends Backbone.View
|
|||
return unless elem.data('toggle') is 'coco-modal'
|
||||
target = elem.data('target')
|
||||
view = application.router.getView(target, '_modal') # could set up a system for loading cached modals, if told to
|
||||
console.log "got target", target, "which gave view", view
|
||||
@openModalView(view)
|
||||
|
||||
openModalView: (modalView, softly=false) ->
|
||||
|
|
|
@ -5,16 +5,16 @@ CocoModel = require 'models/CocoModel'
|
|||
module.exports = class RevertModal extends ModalView
|
||||
id: 'revert-modal'
|
||||
template: template
|
||||
|
||||
|
||||
events:
|
||||
'click #changed-models button': 'onRevertModel'
|
||||
|
||||
|
||||
onRevertModel: (e) ->
|
||||
id = $(e.target).val()
|
||||
CocoModel.backedUp[id].revert()
|
||||
$(e.target).closest('tr').remove()
|
||||
@reloadOnClose = true
|
||||
|
||||
|
||||
getRenderData: ->
|
||||
c = super()
|
||||
models = _.values CocoModel.backedUp
|
||||
|
@ -23,5 +23,4 @@ module.exports = class RevertModal extends ModalView
|
|||
c
|
||||
|
||||
onHidden: ->
|
||||
console.log 'reload?', @reloadOnClose
|
||||
location.reload() if @reloadOnClose
|
||||
|
|
Loading…
Reference in a new issue