Make welcome-hero close into an action

This commit is contained in:
Toby Zerner 2015-01-30 12:13:06 +10:30
parent 9de06497a9
commit 04937646fb
3 changed files with 5 additions and 25 deletions

View File

@ -5,11 +5,10 @@ export default Ember.Component.extend({
tagName: 'header',
classNames: ['hero', 'welcome-hero'],
didInsertElement: function() {
var hero = this.$();
hero.find('.close').click(function() {
hero.slideUp();
});
actions: {
close: function() {
this.$().slideUp();
}
}
});

View File

@ -1,19 +0,0 @@
import Ember from 'ember';
export default Ember.Controller.extend({
needs: ['index'],
user: Ember.Object.create({avatarNumber: 1}),
showing: false,
title: 'Replying to <em>Some Discussion Title</em>',
actions: {
close: function() {
this.set('showing', false);
}
}
});

View File

@ -1,5 +1,5 @@
<div class="container">
<button class="close btn btn-icon btn-link">{{fa-icon "times"}}</button>
<button class="close btn btn-icon btn-link" {{action "close"}}>{{fa-icon "times"}}</button>
<div class="container-narrow">
<h2>Welcome to Flarum Prototype Forum</h2>
<p>Thanks for stopping by! Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Maecenas sed diam eget risus varius blandit sit amet non magna.</p>