This repository has been archived by the owner on Sep 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
marfnk
committed
Aug 12, 2013
1 parent
96f5dbc
commit b600dcf
Showing
7 changed files
with
47 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,37 @@ | ||
var LegendView = Backbone.View.extend({ | ||
tagName: 'ul', | ||
className: 'list timeseries', | ||
actions: [ | ||
{ | ||
'icon': 'icon-trash', | ||
'callback': 'timeseries:delete' | ||
}, | ||
{ | ||
'icon': 'icon-screenshot', | ||
'callback': 'station:locate', | ||
'navigate': '#add/map' | ||
} | ||
], | ||
|
||
initialize: function(){ | ||
this.listenTo(this.collection, 'add', this.render); | ||
this.listenTo(this.collection, 'remove', this.render); | ||
}, | ||
|
||
render: function() { | ||
this.$el.empty(); | ||
|
||
if (this.collection.length == 0) { | ||
this.$el.html("No current timeseries.<br/>Go on, <a href='#add'>add</a> one."); | ||
} | ||
|
||
list = this.$el; | ||
actions = this.actions; | ||
this.collection.each(function(timeserie){ | ||
stationView = new TimeserieView({'model': timeserie}); | ||
list.append(stationView.render().el); | ||
tsView = new TimeserieView({'model': timeserie, 'actions': actions}); | ||
list.append(tsView.render().el); | ||
}); | ||
|
||
return this; | ||
} | ||
|
||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters