Make focus state distinct until changed on Focusable objects

This commit is contained in:
Nathan Sobo
2014-01-09 15:43:05 -07:00
parent 466868e639
commit af3ca57094

View File

@@ -8,6 +8,7 @@ class Focusable extends Mixin
@$focusContext
.flatMapLatest((context) -> context?.$focusedObject)
.map((focusedObject) => focusedObject is this)
.distinctUntilChanged()
focus: ->
throw new Error("Object must be assigned a focusContext to be focus") unless @focusContext