File tree Expand file tree Collapse file tree 4 files changed +25
-0
lines changed
packages/perspective-viewer/src Expand file tree Collapse file tree 4 files changed +25
-0
lines changed Original file line number Diff line number Diff line change 3131 </ div >
3232 < perspective-computed-column > </ perspective-computed-column >
3333 </ div >
34+ < div id ="resize_bar "> </ div >
3435 </ div >
3536 < div class ="column noselect ">
3637 < div id ='top_panel '>
Original file line number Diff line number Diff line change @@ -198,6 +198,18 @@ export class ActionElement extends DomElement {
198198 this . setAttribute ( "column-pivots" , row_pivots ) ;
199199 }
200200
201+ _resize_sidepanel ( ) {
202+ const resize = event => {
203+ this . _side_panel . style . width = `${ event . clientX } px` ;
204+ } ;
205+ const stop = ( ) => {
206+ document . removeEventListener ( "mousemove" , resize ) ;
207+ document . removeEventListener ( "mouseup" , stop ) ;
208+ } ;
209+ document . addEventListener ( "mousemove" , resize ) ;
210+ document . addEventListener ( "mouseup" , stop ) ;
211+ }
212+
201213 // most of these are drag and drop handlers - how to clean up?
202214 _register_callbacks ( ) {
203215 this . _sort . addEventListener ( "drop" , drop . bind ( this ) ) ;
@@ -236,6 +248,7 @@ export class ActionElement extends DomElement {
236248 this . _download_button . addEventListener ( "click" , event => this . download ( event . shiftKey ) ) ;
237249 this . _transpose_button . addEventListener ( "click" , this . _transpose . bind ( this ) ) ;
238250 this . _drop_target . addEventListener ( "dragover" , dragover . bind ( this ) ) ;
251+ this . _resize_bar . addEventListener ( "mousedown" , this . _resize_sidepanel . bind ( this ) ) ;
239252
240253 this . _vis_selector . addEventListener ( "change" , ( ) => {
241254 this . setAttribute ( "plugin" , this . _vis_selector . value ) ;
Original file line number Diff line number Diff line change @@ -270,6 +270,7 @@ export class DomElement extends PerspectiveElement {
270270 this . _plugin_information_action = this . shadowRoot . querySelector ( ".plugin_information__action" ) ;
271271 this . _plugin_information_dismiss = this . shadowRoot . querySelector ( ".plugin_information__action--dismiss" ) ;
272272 this . _plugin_information_message = this . shadowRoot . querySelector ( "#plugin_information_count" ) ;
273+ this . _resize_bar = this . shadowRoot . querySelector ( "#resize_bar" ) ;
273274 }
274275
275276 // sets state, manipulates DOM
Original file line number Diff line number Diff line change 413413 }
414414 }
415415 #side_panel {
416+ position : relative ;
416417 flex : 0 0 auto ;
417418 padding : var (--side_panel--padding , 10px 10px 0px 11px );
418419 }
438439 color : var (--button-hover--color , inherit );
439440 }
440441 }
442+
443+ #resize_bar {
444+ position : absolute ;
445+ top : 0 ;
446+ right : 0 ;
447+ bottom : 0 ;
448+ width : 8px ;
449+ cursor : col-resize ;
450+ }
441451}
You can’t perform that action at this time.
0 commit comments