addon/components/bsy-alert.js in bootstrap-bookingsync-sass-1.0.5 vs addon/components/bsy-alert.js in bootstrap-bookingsync-sass-2.0.0
- old
+ new
@@ -1,28 +1,26 @@
-import Ember from 'ember';
-const { computed } = Ember;
+import Component from '@ember/component';
+import { computed } from '@ember/object';
import layout from '../templates/components/bsy-alert';
-export default Ember.Component.extend({
+export default Component.extend({
layout,
classNames: 'alert',
classNameBindings: ['typeClassName', 'dismissibleClassName'],
attributeBindings: ['role'],
role: 'alert',
dismissible: false,
typeClassName: computed('type', function() {
- return 'alert-' + this.get('type');
+ return `alert-${this.type}`;
}),
dismissibleClassName: computed('dismissible', function() {
- if (this.get('dismissible') === true) {
- return 'alert-dismissible';
- }
+ return this.dismissible ? 'alert-dismissible' : '';
}),
actions: {
- dismiss: function() {
+ dismiss() {
this._renderNode.destroy();
}
}
});