Skip to content

Commit a746c2d

Browse files
feat(style): add Sort icon hint on hover when column is sortable (#435)
- we now show a hint while hovering the column. It helps identify if the hovering column is sortable or not, if user doesn't want this behavior he can simply change the SASS variable to opacity of 0. Co-authored-by: Ghislain Beaulac <ghislain.beaulac@se.com>
1 parent 0d5a150 commit a746c2d

File tree

4 files changed

+17
-1
lines changed

4 files changed

+17
-1
lines changed

src/app/examples/grid-headermenu.component.scss

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ $header-menu-button-border-width: 0px 1px;
33
$header-menu-button-icon: "\f0d7";
44
$header-menu-button-width: 16px;
55
$header-menu-button-padding: 10px 0 0 3px;
6+
$sort-indicator-hint-opacity: 0;
67

78
/* make sure to add the @import the SlickGrid Bootstrap Theme AFTER the variables changes */
89
@import '../modules/angular-slickgrid/styles/slickgrid-theme-bootstrap.scss';

src/app/modules/angular-slickgrid/styles/_variables.scss

+4-1
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,15 @@ $autocomplete-z-index: 1000 !default;
123123
$icon-sort-asc: "\f0d8" !default;
124124
$icon-sort-desc: "\f0d7" !default;
125125
$icon-sort-color: rgb(76, 128, 190) !default;
126+
$icon-sort-font-size: $icon-font-size !default;
126127
$icon-sort-position-right: 10px !default;
127128
$icon-sort-position-top: ((15px * $header-row-count) - 15px) !default;
128129
$sort-indicator-number-font-size: 10px !default;
129130
$sort-indicator-number-width: 8px !default;
130131
$sort-indicator-number-left: auto !default;
131132
$sort-indicator-number-right: 0px !default;
132133
$sort-indicator-number-top: (13px * $header-row-count) !default;
134+
$sort-indicator-hint-opacity: 0.5 !default;
133135

134136
/* Grouping Totals Formatter */
135137
$group-totals-formatter-color: gray !default;
@@ -304,6 +306,7 @@ $header-menu-button-bg-color: #ffffff !default;
304306
$header-menu-border: 1px solid #BFBDBD !default;
305307
$header-menu-button-border: $header-menu-border !default;
306308
$header-menu-button-border-width: 0px !default;
309+
$header-menu-button-height: 35px !default;
307310
$header-menu-button-icon: "\f13a" !default;
308311
$header-menu-button-padding: 0px !default;
309312
$header-menu-border-radius: 2px !default;
@@ -333,7 +336,7 @@ $checkbox-selector-opacity-hover: 0.35 !default;
333336

334337
/* Editors */
335338
$large-editor-background-color: #ffffff !default;
336-
$large-editor-border: 2px solid gray !default;
339+
$large-editor-border: 2px solid #a0a0a0 !default;
337340
$large-editor-text-padding: 5px !default;
338341
$large-editor-border-radius: 8px !default;
339342
$large-editor-textarea-height: 80px !default;

src/app/modules/angular-slickgrid/styles/slick-bootstrap.scss

+11
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,17 @@
299299
color: $slickgridHoverHeaderColor;
300300
}
301301

302+
/* when sorting is possible and there's not yet a sort applied on the column
303+
we could display the sort ascending icon (with an opacity) as a hint */
304+
&.ui-sortable-handle.ui-state-hover:not(.slick-header-column-sorted) {
305+
.slick-sort-indicator:before {
306+
content: $icon-sort-asc;
307+
font-family: $icon-font-family;
308+
font-size: $icon-sort-font-size;
309+
opacity: $sort-indicator-hint-opacity;
310+
}
311+
}
312+
302313
.slick-sort-indicator {
303314
background: none;
304315
font-family: $icon-font-family;

src/app/modules/angular-slickgrid/styles/slick-plugins.scss

+1
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@
268268
cursor: pointer;
269269
display: none;
270270
position: absolute;
271+
height: $header-menu-button-height;
271272
border: $header-menu-button-border;
272273
border-width: $header-menu-button-border-width;
273274
padding: $header-menu-button-padding;

0 commit comments

Comments
 (0)