File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
src/BootstrapBlazor/Components/Layout Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -6,8 +6,8 @@ export function init(id) {
66 return ;
77 }
88
9- const min = parseFloat ( el . getAttribute ( "data-bb-min" ) ?? "0 " ) ;
10- const max = parseFloat ( el . getAttribute ( "data-bb-max" ) ?? "0 " ) ;
9+ const min = parseFloat ( el . getAttribute ( "data-bb-min" ) ?? "-1 " ) ;
10+ const max = parseFloat ( el . getAttribute ( "data-bb-max" ) ?? "-1 " ) ;
1111 const selector = el . getAttribute ( "data-bb-selector" ) ?? ".layout" ;
1212 const section = document . querySelector ( selector ) ;
1313 const bar = el . querySelector ( ".layout-splitebar-body" ) ;
@@ -23,9 +23,13 @@ export function init(id) {
2323 const eventX = e . clientX || ( e . touches . length > 0 && e . touches [ 0 ] . clientX )
2424 const moveX = eventX - originX
2525 const newWidth = width + moveX
26- if ( newWidth >= min && newWidth <= max ) {
27- section . style . setProperty ( '--bb-layout-sidebar-width' , ` ${ newWidth } px` )
26+ if ( min > - 1 && newWidth < min ) {
27+ newWidth = min
2828 }
29+ if ( max > - 1 && newWidth > max ) {
30+ newWidth = max
31+ }
32+ section . style . setProperty ( '--bb-layout-sidebar-width' , `${ newWidth } px` )
2933 } ,
3034 e => {
3135 bar . classList . remove ( 'drag' )
You can’t perform that action at this time.
0 commit comments