use mustache to abstract out html logic in javascript
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
//= require twitter/bootstrap/bootstrap-typeahead
|
||||
//= require twitter/bootstrap/bootstrap-affix
|
||||
//= require qwaiter
|
||||
//= require mustache
|
||||
//= require_directory .
|
||||
//= require_self
|
||||
var path_mapping = {
|
||||
@@ -176,9 +177,20 @@ $(function(){
|
||||
container.show();
|
||||
}
|
||||
$('[data-t]').each(function(){$(this).text(t($(this).attr('data-t')))})
|
||||
setTranslations();
|
||||
});
|
||||
function setLocale(locale){
|
||||
QMobile.setLocale(locale);
|
||||
$locale = locale;
|
||||
$('[data-t]').each(function(){$(this).text(t($(this).attr('data-t')))})
|
||||
setTranslations();
|
||||
}
|
||||
function Qupdate(selector){
|
||||
setTranslations(selector);
|
||||
}
|
||||
function setTranslations(selector){
|
||||
if(selector){
|
||||
$(selector).find('[data-t]').each(function(){$(this).text(t($(this).attr('data-t')))})
|
||||
}else{
|
||||
$('[data-t]').each(function(){$(this).text(t($(this).attr('data-t')))})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user