From d7056c65093a35e7a7892abddc2830535d9d6aef Mon Sep 17 00:00:00 2001 From: Alain Horner Date: Mon, 21 May 2012 22:33:21 +0200 Subject: [PATCH] adapted styling --- css/main.css | 33 +++++++++++++++++++++++++++++++++ index.html | 25 ++++--------------------- js/main.js | 5 +---- js/model/CheeseList.js | 1 - js/model/CheeseModel.js | 1 - js/view/CheeseListView.js | 5 ++--- js/view/CheeseView.js | 3 +-- 7 files changed, 41 insertions(+), 32 deletions(-) diff --git a/css/main.css b/css/main.css index 6a5a496..388f37d 100644 --- a/css/main.css +++ b/css/main.css @@ -1,4 +1,37 @@ body { padding-top: 60px; padding-bottom: 40px; + overflow-y: scroll; +} + +#content ul { + margin: 0; +} + +#content li { + list-style: none; + border-bottom: 1px solid #EEE; + padding: 10px 0; +} + +#content li span { + padding-left: 10px; + font-size: 1.2em; +} + +#content a.imgwrapper, +#content a.imgwrapper img { + display: inline-block; +} + +.icon-heart { + padding-right: 4px; +} + +.mini { + width: 100px; +} + +.maxi { + margin: 4px 0 10px; } diff --git a/index.html b/index.html index dad7b01..2144c1e 100755 --- a/index.html +++ b/index.html @@ -25,7 +25,7 @@ @@ -34,29 +34,12 @@
-

-
+
homecontent
- - - - - - - - - - - - - - - - + diff --git a/js/main.js b/js/main.js index 43ac2f6..f3fefd9 100755 --- a/js/main.js +++ b/js/main.js @@ -1,4 +1,3 @@ -/*global YUI */ YUI({ modules: { 'cheese-model': { @@ -50,7 +49,6 @@ YUI({ this.showView('cheeseList', { model: myCheeseList }); - Y.one('#subheading').set('text', 'Mmmmmmh, cheese'); } }, { path: '/cheese/:id', @@ -61,7 +59,6 @@ YUI({ this.showView('cheese', { model: cheeseModel }); - Y.one('#subheading').set('text', cheeseModel.get('type')); } else { this.fire('error', { type : 'cheese not found', @@ -73,6 +70,6 @@ YUI({ }); app.render(); - //app.navigate('/cheese'); +// app.navigate('/cheese'); }); diff --git a/js/model/CheeseList.js b/js/model/CheeseList.js index a273bbf..9a33611 100644 --- a/js/model/CheeseList.js +++ b/js/model/CheeseList.js @@ -1,4 +1,3 @@ -/*global YUI */ YUI.add('cheese-list', function (Y) { 'use strict'; diff --git a/js/model/CheeseModel.js b/js/model/CheeseModel.js index 1725e44..7bf873c 100644 --- a/js/model/CheeseModel.js +++ b/js/model/CheeseModel.js @@ -1,4 +1,3 @@ -/*global YUI */ YUI.add('cheese-model', function (Y) { 'use strict'; diff --git a/js/view/CheeseListView.js b/js/view/CheeseListView.js index 9f95b41..ac78286 100644 --- a/js/view/CheeseListView.js +++ b/js/view/CheeseListView.js @@ -1,12 +1,11 @@ -/*global YUI */ YUI.add('cheese-list-view', function (Y) { 'use strict'; Y.CheeseListView = Y.Base.create('cheeseListView', Y.View, [], { - _template: '

There are ({pieces} pieces remaining)

', - _itemTemplate: '
  • Delicious {type} ({pieces} pieces remaining)
  • ', + _template: '

    Mmmmmmh, cheese

    There are {pieces} pieces remaining in total

    ', + _itemTemplate: '
  • {type} imageDelicious {type} ({pieces} piece(s) remaining)
  • ', render: function () { var container = this.get('container'), diff --git a/js/view/CheeseView.js b/js/view/CheeseView.js index 9da14f2..95d6da6 100644 --- a/js/view/CheeseView.js +++ b/js/view/CheeseView.js @@ -1,11 +1,10 @@ -/*global YUI */ YUI.add('cheese-view', function (Y) { 'use strict'; Y.CheeseView = Y.Base.create('cheeseView', Y.View, [], { - _template: '{pieces} piece(s) of delicious {type} remaining.', + _template: '

    {type}

    {type} image

    There are {pieces} piece(s) of delicious {type} remaining.

    ', events: { '.eat': {click: 'eatPiece'}