This repository has been archived by the owner on May 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 79
Events
greenify edited this page Sep 25, 2014
·
6 revisions
This component behaves according to the BioJS 2 events guidelines. This means that the (1) Observer pattern is used and (2) the function have the same name on
, off
, once
.
However this component uses the mediator pattern, so you might listen to g
- the event bus.
If you are trying to understand the Event handling of the views, this is mostly delegated by Backbone.
# residues
msa.on "residue:click", (data) ->
msa.on "residue:mousein", (data) ->
msa.on "residue:mouseout", (data) ->
data consists of
seqId: row
rowPos: columnid
evt: original event
# rows (click done by the label)
msa.on "row:click", (data) ->
msa.on "row:mousein", (data) ->
msa.on "row:mouseout", (data) ->
# click done by the
msa.on "column:click", (data) ->
msa.on "column:mousein", (data) ->
msa.on "column:mouseout", (data) ->
msa.on "meta:click", (data) ->
msa.on "meta:mousein", (data) ->
msa.on "meta:mouseout", (data) ->
msa.on "seq:add" # data = sequence object
msa.on "redraw"
You can also listen to any change of any model. See Backbone listenTo
for more details.
msa.g.zoomer.on "change:visibleText" (model,property) ->