Use _.uniqueId to generate temporary subview divs.

This commit is contained in:
Corey Johnson & Nathan Sobo
2011-12-29 11:58:59 -06:00
parent 79ead1fefb
commit 8455507566
2 changed files with 4 additions and 5 deletions

View File

@@ -14,7 +14,7 @@ describe "RootView", ->
expect(rootView.vertical.children().length).toBe 2
describe "toggleFileFinder", ->
fit "shows the FileFinder when it is not on screen and hides it when it is", ->
it "shows the FileFinder when it is not on screen and hides it when it is", ->
#expect(rootView.find('.file-finder')).not.toExist()
# rootView.toggleFileFinder()
# expect(rootView.find('.file-finder')).toExist()

View File

@@ -42,12 +42,12 @@ class Builder
@document.push(new CloseTag(name))
subview: (outletName, template, params) ->
subviewId = ++@subviewCount
@tag 'div', subview: subviewId
subviewId = _.uniqueId('subview')
@tag 'div', id: subviewId
@postProcessingFns.push (view) ->
subview = template.build(params)
subview.attr('outlet', outletName)
view.find("div[subview=#{subviewId}]").replaceWith(subview)
view.find("div##{subviewId}").replaceWith(subview)
elementIsVoid: (name) ->
name in @constructor.elements.void
@@ -65,7 +65,6 @@ class Builder
@document.push(new Text(string))
reset: ->
@subviewCount = 0
@document = []
@postProcessingFns = []