Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make column hider button appear when there are no scrollbars #1372

Merged
merged 1 commit into from
May 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions css/dgrid.css
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ html.has-mozilla .dgrid-focus {
position: absolute;
right: 0;
top: 0;
z-index: 99999;
}
.dgrid-rtl-swap .dgrid-hider-toggle {
right: auto;
Expand Down
4 changes: 2 additions & 2 deletions extensions/ColumnHider.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ define([
// First run
// Assume that if this plugin is used, then columns are hidable.
// Create the toggle node.
hiderToggleNode = this.hiderToggleNode = domConstruct.create('button', {
hiderToggleNode = this.hiderToggleNode = domConstruct.create('div', {
'aria-label': this.i18nColumnHider.popupTriggerLabel,
className: 'ui-icon dgrid-hider-toggle',
type: 'button'
Expand All @@ -157,7 +157,7 @@ define([
// browsers. Hopefully any browsers (or updates) introduced since then that reduce the scrollbar width
// also include support for scaling with CSS transforms.
scrollbarWidth = this.bodyNode.offsetWidth - this.bodyNode.clientWidth;
if (scrollbarWidth < 16) {
if (scrollbarWidth < 16 && scrollbarWidth > 0) {
hiderNodeScale = scrollbarWidth / 16;
hiderNodeTranslate = (16 - scrollbarWidth) / 2;
hiderToggleNode.style.transform = 'scale(' + (hiderNodeScale) + ') translate(' +
Expand Down