mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-24 08:08:15 -05:00
Refactor DeltaView to use view in template
This commit is contained in:
parent
c10d11f61b
commit
0869b11f53
2 changed files with 4 additions and 9 deletions
|
@ -1,4 +1,5 @@
|
|||
- var i = 0
|
||||
- var counter = view.constructor.deltaCounter;
|
||||
|
||||
mixin deltaPanel(delta, conflict)
|
||||
- delta.index = i++
|
||||
|
@ -41,8 +42,8 @@ mixin deltaPanel(delta, conflict)
|
|||
+deltaPanel(delta.conflict, true)
|
||||
|
||||
.panel-group(id='delta-accordion-'+(counter))
|
||||
for delta in deltas
|
||||
for delta in view.expandedDeltas
|
||||
+deltaPanel(delta)
|
||||
if !deltas.length
|
||||
if !view.expandedDeltas.length
|
||||
alert.alert-warning(data-i18n="delta.no_changes") No changes
|
||||
|
||||
|
|
|
@ -71,14 +71,8 @@ module.exports = class DeltaView extends CocoView
|
|||
if skip then skippedDeltas.push delta else newDeltas.push delta
|
||||
[newDeltas, skippedDeltas]
|
||||
|
||||
getRenderData: ->
|
||||
c = super()
|
||||
c.deltas = @expandedDeltas
|
||||
c.counter = DeltaView.deltaCounter
|
||||
DeltaView.deltaCounter += @expandedDeltas.length
|
||||
c
|
||||
|
||||
afterRender: ->
|
||||
DeltaView.deltaCounter += @expandedDeltas.length
|
||||
deltas = @$el.find('.details')
|
||||
for delta, i in deltas
|
||||
deltaEl = $(delta)
|
||||
|
|
Loading…
Reference in a new issue