Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixing itemviewclass stuff

  • Loading branch information...
commit 5b3b239661a479c0256a306d45b3e4133815ce2c 1 parent 2f4110f
Kuba Kuźma authored
Showing with 17 additions and 14 deletions.
  1. +1 −2  index.html
  2. +16 −12 lib/main.js
3  index.html
View
@@ -35,8 +35,7 @@
<span class="deck-count">4 cards</span>
</div>
- {{#collection Ficha.CardsView class="cards"}}
- {{/collection}}
+ {{collection Ficha.CardsView class="cards"}}
</div>
</div>
28 lib/main.js
View
@@ -22,14 +22,29 @@ Ficha.Card.FIXTURES = [
{ id: "3", front: "abstruse", back: "difficult to understand; obscure" }
];
+// controllers
+
Ficha.cardsController = SC.ArrayController.create({
content: []
});
+Ficha.cardController = SC.Object.create({
+
+});
+
+// views
+
+Ficha.CardView = SC.View.extend({
+ tagName: "li",
+ templateName: "card",
+ cardBinding: "content",
+ classNames: ["card"]
+});
+
Ficha.CardsView = SC.CollectionView.extend({
tagName: "ul",
contentBinding: "Ficha.cardsController.content",
- itemClassView: Ficha.CardView
+ itemViewClass: Ficha.CardView
});
Ficha.NewCardView = SC.View.extend({
@@ -37,21 +52,10 @@ Ficha.NewCardView = SC.View.extend({
templateName: "card-new"
});
-Ficha.CardView = SC.View.extend({
- tagName: "li",
- templateName: "card",
- cardBinding: "content",
- template: Handlebars.compile("dupa")
-});
-
Ficha.CardSideTextArea = SC.TextArea.extend({
attributeBindings: ["rows", "cols"],
rows: "2",
cols: "12"
});
-Ficha.cardController = SC.Object.create({
-
-});
-
Ficha.cardsController.set("content", Ficha.store.find(Ficha.Card));
Please sign in to comment.
Something went wrong with that request. Please try again.