add animation when button is clicked and fix title in button (#2488)

* add animation similar to toolbar in vscode and fix title in button

* remove bur method in button
This commit is contained in:
Abbie Petchtes
2018-09-11 10:37:02 -07:00
committed by GitHub
parent 4ea13bdbc0
commit a5c537197c
7 changed files with 59 additions and 5 deletions

View File

@@ -23,6 +23,18 @@ export class Button extends vsButton {
this.$el.style('outline-color', this.buttonFocusOutline ? this.buttonFocusOutline.toString() : null);
this.$el.style('outline-width', '1px');
});
this.$el.on(DOM.EventType.MOUSE_DOWN, (e) => {
const mouseEvent = e as MouseEvent;
if (!this.$el.hasClass('disabled') && mouseEvent.button === 0) {
this.$el.addClass('active');
}
});
this.$el.on([DOM.EventType.MOUSE_UP], (e) => {
DOM.EventHelper.stop(e);
this.$el.removeClass('active');
});
}
public style(styles: IButtonStyles): void {