Browse files

changed CSS on selected list

  • Loading branch information...
1 parent 05fc9b1 commit 2fb714cc521d32f74663012a4cef833c05695581 @Rich-Harris Rich-Harris committed Jan 28, 2012
Showing with 33 additions and 4 deletions.
  1. +14 −1 src/view.js
  2. +19 −3 styles/yourtopia.css
View
15 src/view.js
@@ -14,7 +14,8 @@ my.SeriesListing = Backbone.View.extend({
},
events: {
- 'click li': 'selectSeries'
+ 'click .universe li': 'selectSeries',
+ 'click .selection li': 'removeSeries'
},
selectSeries: function(e) {
@@ -26,6 +27,17 @@ my.SeriesListing = Backbone.View.extend({
}
},
+ removeSeries: function(e) {
+ console.log('removeSeries');
+
+ e.preventDefault();
+ var $target = $(e.target);
+ var selected = this.collection.get($target.data('key'));
+ if ((this.selected.include(selected))) {
+ this.selected.remove(selected);
+ }
+ },
+
render: function() {
}
});
@@ -35,6 +47,7 @@ my.SelectedSeriesListing = Backbone.View.extend({
this.el = $(this.el);
_.bindAll(this, 'render');
this.collection.bind('add', this.render);
+ this.collection.bind('remove', this.render);
},
render: function() {
View
22 styles/yourtopia.css
@@ -9,25 +9,41 @@
.components li {
position: relative;
- padding: 2px 20px 2px 2px;
+ padding: 2px;
cursor: pointer;
}
.components li:hover {
background-color: #efefef;
}
+.universe li {
+ padding-right: 30px;
+}
+.selection li {
+ padding-left: 30px;
+}
+
.components li:after {
- content: '+';
font-family: HeydingsCommonIconsRegular;
font-size: 20px;
position: absolute;
- right: 5px;
top: 50%;
line-height: 0;
+}
+
+.universe li:after {
+ right: 5px;
+ content: '+';
color: rgba(0,200,0,0.7);
}
+.selection li:after {
+ left: 5px;
+ content: '-';
+ color: rgba(200,0,0,0.7);
+}
+
.list {
width: 47%;
margin-right: 3%;

0 comments on commit 2fb714c

Please sign in to comment.