Add match count to path header text

This commit is contained in:
Kevin Sawicki
2013-01-25 13:08:58 -08:00
parent e919759c58
commit 35b7ad5ee3
4 changed files with 14 additions and 2 deletions

View File

@@ -299,7 +299,7 @@ describe "CommandPanel", ->
expect(commandPanel.previewList).toBeVisible()
expect(commandPanel.previewList).toMatchSelector ':focus'
previewItem = commandPanel.previewList.find("li:contains(sample.js):first")
expect(previewItem.text()).toBe "sample.js"
expect(previewItem.text()).toBe "sample.js(1)"
expect(previewItem.next().find('.preview').text()).toBe "var quicksort = function () {"
expect(previewItem.next().find('.preview > .match').text()).toBe "quicksort"

View File

@@ -34,7 +34,9 @@ class PreviewList extends ScrollView
operation.index = index for operation, index in operations
operationsByPath = _.groupBy(operations, (operation) -> operation.getPath())
for path, ops of operationsByPath
@li path, class: 'path'
@li class: 'path', =>
@span path
@span "(#{ops.length})", class: 'path-match-number'
for operation in ops
{prefix, suffix, match, range} = operation.preview()
@li 'data-index': operation.index, class: 'operation', =>

View File

@@ -60,6 +60,11 @@
display: inline-block;
}
.command-panel .preview-list .path-match-number {
padding-left: 8px;
color: rgba(255, 255, 255, .3);
}
.command-panel .preview-list .preview {
word-break: break-all;
}

View File

@@ -57,6 +57,11 @@
display: inline-block;
}
.command-panel .preview-list .path-match-number {
padding-left: 8px;
color: #3D5075;
}
.command-panel .preview-list .preview {
word-break: break-all;
}