Skip to content

Commit 24450c4

Browse files
authored
Merge pull request #407 from martinRenou/improve_toolbar_positionning
Improve toolbar positioning
2 parents ff67bec + d796ef5 commit 24450c4

15 files changed

+8
-8
lines changed

src/mpl_widget.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,10 +397,10 @@ export class MPLCanvasView extends DOMWidgetView {
397397
window.addEventListener('mousemove', this._resize_event);
398398
window.addEventListener('mouseup', this._stop_resize_event);
399399

400-
this.figure.addEventListener('mouseenter', () => {
400+
this.el.addEventListener('mouseenter', () => {
401401
this.toolbar_view.fade_in();
402402
});
403-
this.figure.addEventListener('mouseleave', () => {
403+
this.el.addEventListener('mouseleave', () => {
404404
this.toolbar_view.fade_out();
405405
});
406406

src/toolbar_widget.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,31 +113,31 @@ export class ToolbarView extends DOMWidgetView {
113113
this.toolbar.classList.remove('widget-hbox');
114114
this.toolbar.classList.add('widget-vbox');
115115

116-
this.el.style.top = '3%';
116+
this.el.style.top = '3px';
117117
this.el.style.bottom = 'auto';
118118

119119
if (position === 'left') {
120-
this.el.style.left = '3%';
120+
this.el.style.left = '3px';
121121
this.el.style.right = 'auto';
122122
} else {
123123
this.el.style.left = 'auto';
124-
this.el.style.right = '3%';
124+
this.el.style.right = '3px';
125125
}
126126
} else {
127127
this.el.classList.add('widget-hbox');
128128
this.el.classList.remove('widget-vbox');
129129
this.toolbar.classList.add('widget-hbox');
130130
this.toolbar.classList.remove('widget-vbox');
131131

132-
this.el.style.right = '3%';
132+
this.el.style.right = '3px';
133133
this.el.style.left = 'auto';
134134

135135
if (position === 'top') {
136-
this.el.style.top = '3%';
136+
this.el.style.top = '3px';
137137
this.el.style.bottom = 'auto';
138138
} else {
139139
this.el.style.top = 'auto';
140-
this.el.style.bottom = '3%';
140+
this.el.style.bottom = '3px';
141141
}
142142
}
143143
}
537 Bytes
Loading
585 Bytes
Loading
744 Bytes
Loading
743 Bytes
Loading
743 Bytes
Loading
582 Bytes
Loading
-240 Bytes
Loading
-250 Bytes
Loading

0 commit comments

Comments
 (0)