Skip to content

Commit

Permalink
📦 [refact] 修改Version Panel 类型为blessed.listtable
Browse files Browse the repository at this point in the history
  • Loading branch information
lanjingling0510 committed May 19, 2017
1 parent a19eaa2 commit 27f684b
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 23 deletions.
16 changes: 16 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
1
2
3
4
5
6
7
8
9
[include]
[libs]
./flow
[options]
esproposal.class_static_fields=enable
esproposal.class_instance_fields=enable
suppress_comment= \\(.\\|\n\\)*\\$FlowIgnore
4 changes: 2 additions & 2 deletions src/azer-compare.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ async function selectBaseVersion() {
);
baseTable.updateView(choices);
// 监听选择事件
baseTable.rows.on('select', value => {
baseTable.on('select', value => {
baseVersion = value.content.trim();
updateSummaryView();
if (compareVersion) {
Expand All @@ -60,7 +60,7 @@ async function selectCompareVersion() {
);
compareTable.updateView(choices);
// 监听选择事件
compareTable.rows.on('select', value => {
compareTable.on('select', value => {
compareVersion = value.content.trim();
updateSummaryView();

Expand Down
15 changes: 0 additions & 15 deletions src/util/analyze.js

This file was deleted.

14 changes: 8 additions & 6 deletions src/util/blessed.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ const baseTable = grid.set(
8,
6,
4,
contrib.table,
makeList([24]),
blessed.listtable,
makeScrollList([30]),
);

baseTable.updateView = data => {
baseTable.setData({headers: [], data: data});
baseTable.setData([[], ...data]);
screen.render();
};

Expand All @@ -32,12 +32,12 @@ const compareTable = grid.set(
8,
6,
4,
contrib.table,
makeList([30]),
blessed.listtable,
makeScrollList([30]),
);

compareTable.updateView = data => {
compareTable.setData({headers: [], data: data});
compareTable.setData([[], ...data]);
screen.render();
};

Expand Down Expand Up @@ -128,10 +128,12 @@ function makeScrollList(columnWidth) {
function makeList(columnWidth) {
const options = makeBox();
options.columnSpacing = 1;
options.padding = 1;
options.noCellBorders = true;
options.align = 'left';
options.columnWidth = columnWidth;
options.interactive = true;
options.selectedBg = 'blue';
return options;
}

Expand Down

0 comments on commit 27f684b

Please sign in to comment.