Skip to content

Commit 7a7a92c

Browse files
author
minjk-bl
committed
Variable - variable box scrollable
1 parent 0bb8698 commit 7a7a92c

File tree

3 files changed

+26
-13
lines changed

3 files changed

+26
-13
lines changed

css/file_io/variables.css

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
:root {
22
--color: #525252;
33
}
4-
#vp_var_variableBox table tr:not(:first-child):hover,
5-
#vp_var_variableBox table tr.selected {
4+
#vp_var_variableBox table tbody tr:hover,
5+
#vp_var_variableBox table tbody tr.selected {
66
color: var(--font-hightlight);
77
background-color: #F5F5F5;
88
}
9-
#vp_var_variableBox table tr td:first-child:hover {
9+
#vp_var_variableBox table tbody tr td:hover {
1010
cursor: pointer;
1111
}
12+
#vp_var_variableBox table thead {
13+
position: sticky;
14+
top: 0;
15+
background: white;
16+
}
17+
1218
#vp_varDetailTable table th,
1319
#vp_varDetailTable table td {
1420
padding: 5px;
@@ -25,7 +31,6 @@
2531
#vp_var_variableBox {
2632
width: 100%;
2733
height: 150px;
28-
overflow: hidden;
2934
}
3035
#vp_varDetailTable:empty::after {
3136
content: '(Select variables to preview the data.)';

src/file_io/variables.html

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
11
<div class="vp-option-page" id="vp_varPage">
2-
<div id="vp_var_variableBox">
2+
<div id="vp_var_variableBox" class="vp-scrollbar">
33
<table class="vp-option-table vp-option-horizontal-table-layout">
44
<colgroup><col width="150px"/><col width="*"/></colgroup>
5-
<tr>
6-
<th title="Refresh the list"><span class="vp-multilang" data-caption-id="varName">Variable Name</span><span id="vp_varRefresh"><img src="/nbextensions/visualpython/resource/refresh.svg"/></span></th>
7-
<th title="Click to copy"><span class="vp-multilang" data-caption-id="dataType">Data Type</span></th>
8-
</tr>
5+
<thead>
6+
<tr>
7+
<th>
8+
<span class="vp-multilang" data-caption-id="varName">Variable Name</span>
9+
<span id="vp_varRefresh" title="Refresh the list"><img src="/nbextensions/visualpython/resource/refresh.svg"/></span>
10+
</th>
11+
<th>
12+
<span class="vp-multilang" data-caption-id="dataType">Data Type</span>
13+
</th>
14+
</tr>
15+
</thead>
16+
<tbody>
17+
<!-- variable list -->
18+
</tbody>
919
</table>
1020
</div>
1121
<hr/>

src/file_io/variables.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ define([
6363
this.package = libPandas._PANDAS_FUNCTION[funcOptProp.libID];
6464
}
6565

66-
67-
6866
/**
6967
* Extend vpFuncJS
7068
*/
@@ -135,13 +133,13 @@ define([
135133
, 'str', 'int', 'float', 'bool', 'dict', 'list', 'tuple'
136134
];
137135

138-
var tagTable = this.wrapSelector('#vp_var_variableBox table');
136+
var tagTable = this.wrapSelector('#vp_var_variableBox table tbody');
139137

140138
// variable list table
141139
var tagDetailTable = this.wrapSelector("#vp_varDetailTable");
142140

143141
// initialize tags
144-
$(tagTable).find('tr:not(:first)').remove();
142+
$(tagTable).find('tr').remove();
145143
$(tagDetailTable).html('');
146144

147145
// HTML rendering

0 commit comments

Comments
 (0)