Permalink
Browse files

Font size ready!

  • Loading branch information...
1 parent e3783a6 commit 904d9fb749e8bb6947bbeaad7bdbdf43ce06f24f @crysfel committed Mar 31, 2012
View
@@ -20,6 +20,21 @@ Ext.define('Hymnal.controller.Config',{
}
},
+ init : function(){
+ var me = this,
+ config = localStorage.getItem('hymnal-config');
+
+ if(config){
+ config = Ext.decode(config);
+ }else{
+ config = {
+ fuente : 40
+ };
+ }
+
+ me.getForm().setValues(config);
+ },
+
saveConfig : function(){
var me = this,
form = me.getForm(),
View
@@ -88,14 +88,18 @@ Ext.define('Hymnal.controller.Main',{
var me = this,
carousel,
home = me.getHome(),
- hymns = me.hymns.getRange();
+ hymns = me.hymns.getRange(),
+ config = Ext.decode(localStorage.getItem('hymnal-config'));
Ext.fly('appLoadingIndicator').destroy();
Ext.Viewport.add(home);
+ config = config || {fuente:40};
carousel = me.getHymns();
for(var i=0,len=hymns.length;i<len;i++){
- carousel.addHymn(hymns[i]);
+ var hymn = hymns[i];
+ hymn.set('size',config.fuente);
+ carousel.addHymn(hymn);
}
},
@@ -116,6 +120,8 @@ Ext.define('Hymnal.controller.Main',{
config = Ext.decode(localStorage.getItem('hymnal-config'));
title.setTitle('Hymno #'+id);
+
+ Ext.fly(newValue.renderElement.query('h3')[0]).setStyle('font-size',(config.fuente+10)+'%');
Ext.fly(newValue.renderElement.query('p')[0]).setStyle('font-size',config.fuente+'%');
},
View
@@ -13,6 +13,7 @@ Ext.define('Hymnal.model.Hymn',{
fields : [
{name:'id',type:'int'},'title',
{name:'titlePlain',mapping:'title_plain'},
+ {name:'size',type:'int'},
'preview','content','musicImage'
]
}
@@ -60,7 +60,7 @@ Ext.define('Hymnal.view.HymnsCarousel',{
cls : 'hymn-view',
data : model.getData(),
height: 'auto',
- tpl : '<h3>{title}</h3><p>{content}</p>'
+ tpl : '<h3 style="font-size:{size + 10}%">{title}</h3><p style="font-size:{size}%">{content}</p>'
}]
});
}
View

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -1,12 +1,13 @@
.hymn-view{
+ font-size: 50px;
+
h3{
font-weight:bold;
font-size:1.3em;
text-align:center;
margin:10px 0;
}
p{
- font-size:1em;
white-space:pre-wrap;
margin:10px;
}

0 comments on commit 904d9fb

Please sign in to comment.