I have the following app:
A sliding bar consists of a top and a bottom layer. On the bottom layer is a button component. When I slide the top layer away and try to click the button, just the sliding component click fires, not the button.
What could be the problem?
Templates:
<script type="text/x-handlebars" data-template-name="index">
<h2>Sliding Bar Test</h2>
{{#sliding-bar}}
{{button-click}}
{{/sliding-bar}}
</script>
<script type="text/x-handlebars" data-template-name="components/sliding-bar">
<div class="bar top">
This is on Top
</div>
<div class="bar bottom">
{{yield}}
</div>
</script>
<script type="text/x-handlebars" data-template-name="components/button-click">
Click Me
</script>
Ember Code
window.App = Ember.Application.create();
App.SlidingBarComponent = Ember.Component.extend({
click: function () {
alert('slider clicked');
},
didInsertElement: function() {
var topElem = this.$('.top');
TweenMax.to(topElem, 0.25, {css:{left:-148}, overwrite:"all"});
}
})
App.ButtonClickComponent = Ember.Component.extend({
tagName: 'span',
classNames: ['button'],
click: function () {
alert('button clicked');
}
})
Full Source
There is also a JSBin for the full code
Edit:
I changed the lis to divs, but the problem remains. Any idea?