Skip to content

Commit

Permalink
Merge pull request #407 from martinRenou/improve_toolbar_positionning
Browse files Browse the repository at this point in the history
Improve toolbar positioning
  • Loading branch information
martinRenou authored Dec 15, 2021
2 parents ff67bec + d796ef5 commit 24450c4
Show file tree
Hide file tree
Showing 15 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/mpl_widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -397,10 +397,10 @@ export class MPLCanvasView extends DOMWidgetView {
window.addEventListener('mousemove', this._resize_event);
window.addEventListener('mouseup', this._stop_resize_event);

this.figure.addEventListener('mouseenter', () => {
this.el.addEventListener('mouseenter', () => {
this.toolbar_view.fade_in();
});
this.figure.addEventListener('mouseleave', () => {
this.el.addEventListener('mouseleave', () => {
this.toolbar_view.fade_out();
});

Expand Down
12 changes: 6 additions & 6 deletions src/toolbar_widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,31 +113,31 @@ export class ToolbarView extends DOMWidgetView {
this.toolbar.classList.remove('widget-hbox');
this.toolbar.classList.add('widget-vbox');

this.el.style.top = '3%';
this.el.style.top = '3px';
this.el.style.bottom = 'auto';

if (position === 'left') {
this.el.style.left = '3%';
this.el.style.left = '3px';
this.el.style.right = 'auto';
} else {
this.el.style.left = 'auto';
this.el.style.right = '3%';
this.el.style.right = '3px';
}
} else {
this.el.classList.add('widget-hbox');
this.el.classList.remove('widget-vbox');
this.toolbar.classList.add('widget-hbox');
this.toolbar.classList.remove('widget-vbox');

this.el.style.right = '3%';
this.el.style.right = '3px';
this.el.style.left = 'auto';

if (position === 'top') {
this.el.style.top = '3%';
this.el.style.top = '3px';
this.el.style.bottom = 'auto';
} else {
this.el.style.top = 'auto';
this.el.style.bottom = '3%';
this.el.style.bottom = '3px';
}
}
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 24450c4

Please sign in to comment.