Commit 52522d2a authored by Stas SUȘCOV's avatar Stas SUȘCOV

Update clear button view bindings. Force the view scope.

parent 920eaf35
<button {{action "clearCompleted" target="controller"}}>
Clear completed ({{completed}})
</button>
{{#with view}}
<button {{action "clearCompleted" target="entries"}} >
Clear completed ({{entries.completed}})
</button>
{{/with}}
......@@ -10,15 +10,14 @@ define('app/views/clear_button', [
*/
function( button_html ) {
return Ember.View.extend({
entriesBinding: 'controller.namespace.entriesController',
template: Ember.Handlebars.compile( button_html ),
completedBinding: 'controller.completed',
elementId: 'clear-completed',
classNameBindings: 'buttonClass',
// Observer to update class if completed value changes
buttonClass: function () {
if ( !this.get( 'completed' ) )
if ( !this.getPath( 'entries.completed' ) )
return 'hidden';
}.property( 'completed' )
}.property( 'entries.completed' )
})
}
);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment