File tree Expand file tree Collapse file tree 2 files changed +11
-13
lines changed
Expand file tree Collapse file tree 2 files changed +11
-13
lines changed Original file line number Diff line number Diff line change 55 -moz-box-shadow : 2px 2px 2px silver;
66 -webkit-box-shadow : 2px 2px 2px silver;
77 box-shadow : 2px 2px 2px silver;
8- min-width : 100 px ;
8+ min-width : 150 px ;
99 cursor : default;
1010 position : absolute;
1111 z-index : 20 ;
12-
13- width : 200px ;
14- max-height : 300px ;
1512 overflow : auto;
1613 resize : both;
1714}
Original file line number Diff line number Diff line change 2222 $title . appendTo ( $menu ) ;
2323 }
2424
25- // hide if is not withing the picker div or if user click on the close button
26- $ ( document ) . on ( "click.columnpicker" , function ( e ) {
27- var $parent = $ ( e . target ) . closest ( "div.slick-columnpicker" ) ;
28- if ( ( e . target . className != "slick-columnpicker" && $parent . length === 0 ) || e . target . className == "close" ) {
29- $ ( "div.slick-columnpicker" ) . hide ( options . fadeSpeed ) ;
30- }
31- } ) ;
32-
3325 $menu . on ( "click" , updateColumn ) ;
3426 $list = $ ( "<span class='slick-columnpicker-list' />" ) ;
3527
28+ // Hide the menu on outside click.
29+ $ ( document . body ) . on ( "mousedown" , handleBodyMouseDown ) ;
30+
3631 // destroy the picker if user leaves the page
3732 $ ( window ) . on ( "beforeunload" , destroy ) ;
3833 }
3934
4035 function destroy ( ) {
4136 grid . onHeaderContextMenu . unsubscribe ( handleHeaderContextMenu ) ;
4237 grid . onColumnsReordered . unsubscribe ( updateColumnOrder ) ;
43- $ ( document ) . off ( "click.columnpicker" ) ;
38+ $ ( document . body ) . off ( "mousedown" , handleBodyMouseDown ) ;
4439 $ ( "div.slick-columnpicker" ) . hide ( options . fadeSpeed ) ;
4540 $menu . remove ( ) ;
4641 }
4742
43+ function handleBodyMouseDown ( e ) {
44+ if ( ( $menu && $menu [ 0 ] != e . target && ! $ . contains ( $menu [ 0 ] , e . target ) ) || e . target . className == "close" ) {
45+ $menu . hide ( options . fadeSpeed ) ;
46+ }
47+ }
48+
4849 function handleHeaderContextMenu ( e , args ) {
4950 e . preventDefault ( ) ;
5051 $list . empty ( ) ;
You can’t perform that action at this time.
0 commit comments