Skip to content

Commit 72e13e2

Browse files
committed
chore: improve styling on a few examples
1 parent 9bb45a1 commit 72e13e2

7 files changed

+34
-16
lines changed

examples/example-frozen-row-reordering.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ <h2>
110110
behavior: "selectAndMove",
111111
selectable: false,
112112
resizable: false,
113-
cssClass: "cell-reorder dnd sgi sgi-menu"
113+
cssClass: "cell-reorder dnd sgi sgi-drag sgi-12px"
114114
},
115115
{
116116
id: "name",

examples/example-plugin-contextmenu.html

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,23 @@
4848
color: #ccc;
4949
}
5050

51-
.fake-hyperlink {
51+
.cell-menu-dropdown {
52+
border: 1px solid #a3a3a3;
53+
border-radius: 3px;
54+
display: flex;
55+
align-items: center;
56+
height: 90%;
57+
width: max-content;
58+
padding: 0 6px;
5259
cursor: pointer;
53-
color: #08c;
5460
}
55-
56-
.fake-hyperlink:hover {
57-
text-decoration: underline;
61+
.cell-menu-dropdown.disabled {
62+
border: 1px solid #c6c6c6;
63+
color: #dddddd;
64+
}
65+
.cell-menu-dropdown:hover:not(.disabled) {
66+
background-color: #9e9e9e;
67+
color: white;
5868
}
5969

6070
/**
@@ -185,9 +195,9 @@ <h2>View Source:</h2>
185195
function actionFormatter(row, cell, value, columnDef, dataContext) {
186196
// only enable the Action menu when Priority is set to High (3)
187197
if (dataContext.priority === 3) {
188-
return "<div class='fake-hyperlink'>Action &#9660;</div>";
198+
return `<div class="cell-menu-dropdown">Action <i class="sgi sgi-caret sgi-24px"></i></div>`;
189199
}
190-
return "<div class='disabled'>Action &#9660;</div>";
200+
return `<div class="cell-menu-dropdown disabled">Action <i class="sgi sgi-caret sgi-24px"></i></div>`;
191201
}
192202

193203
function priorityFormatter(row, cell, value, columnDef, dataContext) {

examples/example-row-detail-selection-and-move.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ <h3>Selected Titles:</h3>
255255
columns.splice(columnIndex, 0, checkboxSelectorPlugin.getColumnDefinition());
256256

257257
rowMovePlugin = new Slick.RowMoveManager({
258-
cssClass: 'sgi sgi-menu',
258+
cssClass: 'sgi sgi-drag sgi-10px',
259259
cancelEditOnDrag: true,
260260
singleRowMove: true,
261261
disableRowSelection: true,

examples/example-trading-esm.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ <h2>View Source:</h2>
165165
id: 'quantity', name: 'Qty', field: 'quantity', sortable: true, width: 50,
166166
},
167167
{
168-
id: 'amount', name: 'Amount', field: 'amount', sortable: true, minWidth: 70, width: 105,
168+
id: 'amount', name: 'Amount', field: 'amount', sortable: true, minWidth: 70, width: 110,
169169
formatter: currencyFormatter, groupTotalsFormatter: sumTotalsFormatter
170170
},
171171
{

examples/example14-highlighting.html

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,12 @@
1919

2020
.changed {
2121
background: mistyrose;
22-
border: 1px solid lightcoral;
22+
box-shadow: inset 0 0 0 1px lightcoral;
2323
}
2424

2525
.current-server {
26-
border: 1px solid black;
2726
background: moccasin;
28-
border: 1px solid darksalmon;
27+
box-shadow: inset 0 0 0 1px darksalmon;
2928
}
3029
</style>
3130
</head>
@@ -51,6 +50,7 @@ <h2>Demonstrates</h2>
5150
</ul>
5251
<h2>Controls</h2>
5352
<button onclick="simulateRealTimeUpdates()">Start simulation</button>
53+
<button onclick="stopSimulation()">Stop simulation</button>
5454
<button onclick="findCurrentServer()">Find current server</button>
5555
<h2>View Source:</h2>
5656
<ul>
@@ -69,6 +69,7 @@ <h2>View Source:</h2>
6969
<script src="../dist/browser/plugins/slick.rowmovemanager.js"></script>
7070

7171
<script>
72+
var timer;
7273
var grid;
7374
var data = [];
7475
var columns = [
@@ -145,7 +146,14 @@ <h2>View Source:</h2>
145146
grid.setCellCssStyles("highlight", changes);
146147
grid.render();
147148

148-
setTimeout(simulateRealTimeUpdates, 500);
149+
timer = setTimeout(simulateRealTimeUpdates, 500);
150+
}
151+
152+
function stopSimulation() {
153+
changes = {}; // clear changes
154+
grid.setCellCssStyles("highlight", changes);
155+
grid.render();
156+
clearTimeout(timer);
149157
}
150158

151159
function findCurrentServer() {

examples/example9-row-reordering-simple.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ <h2>View Source:</h2>
6666
behavior: "selectAndMove",
6767
selectable: false,
6868
resizable: false,
69-
cssClass: "slickgrid-cell-reorder sgi sgi-menu"
69+
cssClass: "slickgrid-cell-reorder sgi sgi-drag sgi-12px"
7070
},
7171
{
7272
id: "name",

examples/example9-row-reordering.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ <h2>View Source:</h2>
110110
behavior: "selectAndMove",
111111
selectable: false,
112112
resizable: false,
113-
cssClass: "cell-reorder dnd sgi sgi-menu"
113+
cssClass: "cell-reorder dnd sgi sgi-drag sgi-12px"
114114
},
115115
{
116116
id: "name",

0 commit comments

Comments
 (0)