Skip to content

Instantly share code, notes, and snippets.

@guilhermeaiolfi
Created July 15, 2011 18:02
Show Gist options
  • Save guilhermeaiolfi/1085182 to your computer and use it in GitHub Desktop.
Save guilhermeaiolfi/1085182 to your computer and use it in GitHub Desktop.
sproutcore20 simple question
// mouseLeave is not called when moving the mouse cursor between task. How to do it?
// I would expect it to fire a mouseleave event when going to another task and fire
// a mouseenter in that recently entered task element. That's not what is happening.
(...)
Todos.todosList = SC.CollectionView.extend({
contentBinding: "Todos.todosController",
mouseEnter : function(e)
{
$(e.target).addClass("showControls");
},
mouseLeave : function(e)
{
$(e.target).removeClass("showControls");
}
});
(...)
{{#collection Todos.todosList contentBinding="Todos.todosController" tagName="ul" itemClassBinding="content.isDone"}}
{{view SC.Checkbox titleBinding="parentView.content.title" valueBinding="parentView.content.isDone"}}
<div class="controls">
{{#view SC.Button target="Todos.todosController" action="removeTodo"}}Remove{{/view}}
</div>
{{/collection}}
(...)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment