Render all operations when moving to bottom

This commit is contained in:
Kevin Sawicki
2013-04-03 15:52:47 -07:00
parent a762291de9
commit b50b2231d6
2 changed files with 13 additions and 0 deletions

View File

@@ -112,6 +112,8 @@ class PreviewList extends ScrollView
@scrollTop(top) if top < @scrollTop()
scrollToBottom: ->
@renderOperations(renderAll: true)
super()
@find('.selected').removeClass('selected')

View File

@@ -54,3 +54,14 @@ describe "Preview List", ->
previousOperationCount = previewList.find("li").length
previewList.trigger 'command-panel:collapse-result'
expect(previewList.find("li").length).toBeGreaterThan previousOperationCount
it "renders all operations when core:move-to-bottom is triggered", ->
waitsForPromise ->
commandPanelView.execute('X x/so/')
runs ->
expect(previewList.prop('scrollHeight')).toBeGreaterThan previewList.height()
previousScrollHeight = previewList.prop('scrollHeight')
previewList.trigger 'core:move-to-bottom'
liCount = previewList.getPathCount() + previewList.getOperations().length
expect(previewList.find("li").length).toBe liCount