Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Commit c27255d

Browse files
committed
feat(toggle arrows): Add an option to disable the toggle arrows overall and on mobile devices
Sometimes, the programmer may not want the toggle arrows at all. They also might cause problems on mobile devices. This commit adds the option to turn them off completely or just on mobile devices. Closes #56
1 parent d4585c3 commit c27255d

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,20 @@ Default: `10`
7979

8080
The size in pixels that you want the divider/splitbar to be.
8181

82+
### disableToggle
83+
84+
Type: `Boolean`
85+
Default: `false`
86+
87+
Set to `true` if you don't want the toggle arrows appearing in the splitbar.
88+
89+
### disableMobileToggle
90+
91+
Type: `Boolean`
92+
Default: `false`
93+
94+
Like `disableToggle` above but only removes the arrows on mobile devices (max-device-width: 480px).
95+
8296
## Child Attributes
8397

8498
### uiLayoutContainer

src/ui-layout.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,17 @@
9999
margin-top: 0.45em;
100100
}
101101

102+
/* Allow disabling of icons */
103+
.no-toggle .ui-splitbar-icon {
104+
display: none;
105+
}
106+
107+
@media only screen and (max-device-width: 480px) {
108+
.no-mobile-toggle .ui-splitbar-icon {
109+
display: none;
110+
}
111+
}
112+
102113
@media print {
103114
.ui-splitbar {
104115
display: none;

src/ui-layout.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ angular.module('ui.layout', [])
3030
// set the layout css class
3131
.addClass('ui-layout-' + (opts.flow || 'row'));
3232

33+
if (opts.disableToggle) {
34+
$element.addClass('no-toggle');
35+
}
36+
if (opts.disableMobileToggle) {
37+
$element.addClass('no-mobile-toggle');
38+
}
39+
3340
// Initial global size definition
3441
opts.sizes = opts.sizes || [];
3542
opts.maxSizes = opts.maxSizes || [];

0 commit comments

Comments
 (0)