Make scrolling work
This commit is contained in:
@@ -1,74 +0,0 @@
|
|||||||
$translations = {
|
|
||||||
en: {
|
|
||||||
models: <%= I18n.t('activemodel.models', locale: :en).to_json %>,
|
|
||||||
attributes: <%= I18n.t('activemodel.attributes', locale: :en).to_json %>,
|
|
||||||
helpers: <%= I18n.t('helpers', locale: :en).to_json %>,
|
|
||||||
pagination: <%= I18n.t('views.pagination', locale: :en).to_json %>,
|
|
||||||
},
|
|
||||||
nl: {
|
|
||||||
models: <%= I18n.t('activemodel.models', locale: :nl).to_json %>,
|
|
||||||
attributes: <%= I18n.t('activemodel.attributes', locale: :nl).to_json %>,
|
|
||||||
helpers: <%= I18n.t('helpers', locale: :nl).to_json %>,
|
|
||||||
pagination: <%= I18n.t('views.pagination', locale: :nl).to_json %>,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$transformation_mappings = {
|
|
||||||
downcase: 'toLowerCase',
|
|
||||||
upcase: 'toUpperCase'
|
|
||||||
}
|
|
||||||
|
|
||||||
function t(path, vars){
|
|
||||||
vars || (vars = {});
|
|
||||||
var result, m, translatable, isafety,replacable;
|
|
||||||
var parts = path.split('.');
|
|
||||||
var accessor = '$translations.'+$locale+'["' + parts.join('"]["')+ '"]';
|
|
||||||
try{
|
|
||||||
result = eval(accessor);
|
|
||||||
} catch(err){
|
|
||||||
result = parts[parts.length - 1].capitalize();
|
|
||||||
}
|
|
||||||
if(result == '') return '';
|
|
||||||
if(!result) return parts[parts.length - 1].capitalize();
|
|
||||||
$.each(vars, function(v, value){ result = result.replace('%{'+v+'}', value)});
|
|
||||||
isafety = 0;
|
|
||||||
while(result.indexOf('${') > -1){
|
|
||||||
m = result.match(/\${([\w\.]+(\|\w+)?)}/);
|
|
||||||
if(m[2]){
|
|
||||||
translatable = m[1].replace(m[2], '');
|
|
||||||
operation = $transformation_mappings[m[2].substr(1) || m[2].substr(1)];
|
|
||||||
}else{
|
|
||||||
translatable = m[1];
|
|
||||||
operation = null;
|
|
||||||
}
|
|
||||||
replacable = t(translatable);
|
|
||||||
if(operation) replacable = replacable[operation]();
|
|
||||||
result = result.replace(m[0], replacable);
|
|
||||||
if(isafety > 10) break;
|
|
||||||
isafety += 1;
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
function setLocale(locale){
|
|
||||||
Qstorage.setItem('locale', locale);
|
|
||||||
$locale = locale;
|
|
||||||
setTranslations();
|
|
||||||
}
|
|
||||||
function setTranslations(selector){
|
|
||||||
var list = $('#top-navigation-list');
|
|
||||||
list.find('.locale').show();
|
|
||||||
list.find('.locale-'+$locale).hide();
|
|
||||||
moment.lang($locale);
|
|
||||||
if(selector){
|
|
||||||
$(selector).find('[data-t]').each(function(){$(this).html(t($(this).data('t'), $(this).data('tAttributes')))})
|
|
||||||
$(selector).find('*[data-time]').each(function(){
|
|
||||||
$(this).text(moment($(this).data('time')).format($(this).data('timeFormat') || 'dd D MMM HH:mm'))
|
|
||||||
})
|
|
||||||
}else{
|
|
||||||
$('[data-t]').each(function(){$(this).html(t($(this).data('t'),$(this).data('tAttributes')))})
|
|
||||||
$('*[data-time]').each(function(){
|
|
||||||
$(this).text(moment($(this).data('time')).format($(this).data('timeFormat') || 'dd D MMM HH:mm'))
|
|
||||||
})
|
|
||||||
}
|
|
||||||
$('.datepicker').datepicker("option", $.datepicker.regional[$locale])
|
|
||||||
}
|
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
#= require_self
|
#= require_self
|
||||||
#= require jquery.touchSwipe
|
# require jquery.touchSwipe
|
||||||
#= require handlebars
|
#= require handlebars
|
||||||
#= require ember
|
#= require ember
|
||||||
#= require ember-data
|
#= require ember-data
|
||||||
@@ -1,19 +1,31 @@
|
|||||||
App.ApplicationView = Ember.View.extend
|
App.ApplicationView = Ember.View.extend
|
||||||
didInsertElement: ->
|
didInsertElement: ->
|
||||||
# Side menu collapsing
|
# Side menu collapsing
|
||||||
targets = @$('.side-menu')
|
side_menu = @$('.side-menu')
|
||||||
targets.addClass('closed').click -> targets.toggleClass('active').addClass('clicked').toggleClass('closed')
|
side_menu.addClass('closed').click -> side_menu.toggleClass('active').addClass('clicked').toggleClass('closed')
|
||||||
controller = @get('controller')
|
controller = @get('controller')
|
||||||
@$('.main-section').swipe
|
#@$('.main-section').swipe
|
||||||
swipe: (event, direction, distance, duration, fingerCount) ->
|
#swipe: (event, direction, distance, duration, fingerCount) ->
|
||||||
if fingerCount is 2
|
#if fingerCount is 2
|
||||||
if direction is "right"
|
#if direction is "right"
|
||||||
targets.addClass('active clicked').removeClass('closed')
|
#side_menu.addClass('active clicked').removeClass('closed')
|
||||||
if direction is "left"
|
#if direction is "left"
|
||||||
targets.removeClass('active').addClass('closed')
|
#side_menu.removeClass('active').addClass('closed')
|
||||||
if fingerCount is 3 and direction is "up"
|
#if fingerCount is 3 and direction is "up"
|
||||||
controller.transitionToRoute "settings"
|
#controller.transitionToRoute "settings"
|
||||||
fingers: 'all'
|
#fingers: 'all'
|
||||||
|
document.addEventListener "backbutton", =>
|
||||||
|
# close side menu if open
|
||||||
|
if side_menu.hasClass('active')
|
||||||
|
side_menu.click()
|
||||||
|
else
|
||||||
|
# close the app when on the index route
|
||||||
|
if @controller.currentPath is 'index'
|
||||||
|
navigator.app.exitApp()
|
||||||
|
else
|
||||||
|
# go to index route otherwise
|
||||||
|
@controller.transitionToRoute 'index'
|
||||||
|
document.addEventListener "menubutton", -> side_menu.click()
|
||||||
|
|
||||||
#ios7 detection
|
#ios7 detection
|
||||||
if window.device and window.device.platform and window.device.platform.toLowerCase() is "ios" and parseFloat(window.device.version) >= 7.0
|
if window.device and window.device.platform and window.device.platform.toLowerCase() is "ios" and parseFloat(window.device.version) >= 7.0
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#= require jquery
|
#= require jquery
|
||||||
#= require ../app/application
|
#= require ../app/manifest
|
||||||
#= require faye
|
#= require faye
|
||||||
#= require moment
|
#= require moment
|
||||||
#= require translations
|
#= require translations
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ body
|
|||||||
bottom: 0
|
bottom: 0
|
||||||
overflow-y: scroll
|
overflow-y: scroll
|
||||||
-webkit-overflow-scrolling: touch
|
-webkit-overflow-scrolling: touch
|
||||||
|
//z-index: 0
|
||||||
|
//-webkit-transform: translateZ(0px)
|
||||||
.main-section-content
|
.main-section-content
|
||||||
//nothing
|
//nothing
|
||||||
span.icon
|
span.icon
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
0.9.28
|
0.9.40
|
||||||
|
|||||||
Reference in New Issue
Block a user