diff --git a/front/core/components/snackbar/snackbar.js b/front/core/components/snackbar/snackbar.js index 4106ffedd..2c794bdae 100644 --- a/front/core/components/snackbar/snackbar.js +++ b/front/core/components/snackbar/snackbar.js @@ -46,11 +46,11 @@ export default class Controller extends Component { let parent = this.snackbar.querySelectorAll('.shape')[0]; - if (parent) { + if (parent) this.snackbar.insertBefore(shape, parent); - } else { + else this.snackbar.appendChild(shape); - } + return shape; } @@ -108,11 +108,10 @@ export default class Controller extends Component { } onButtonClick(shape) { - if (this.actionHandler) { + if (this.actionHandler) this.actionHandler(); - } else { + else this.hide(shape); - } } } Controller.$inject = ['$element', '$translate'];