Skip to content

Commit

Permalink
Copied from Kidoju-WebApp
Browse files Browse the repository at this point in the history
  • Loading branch information
jlchereau committed Oct 22, 2016
1 parent 317d9b8 commit c84383e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 34 deletions.
6 changes: 6 additions & 0 deletions build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ IF "%1"=="" GOTO BLANK
IF "%1"=="d" GOTO DEVELOPMENT
IF "%1"=="dev" GOTO DEVELOPMENT
IF "%1"=="development" GOTO DEVELOPMENT
IF "%1"=="m" GOTO MOBILE
IF "%1"=="mob" GOTO MOBILE
IF "%1"=="mobile" GOTO MOBILE
IF "%1"=="p" GOTO PRODUCTION
IF "%1"=="prod" GOTO PRODUCTION
IF "%1"=="production" GOTO PRODUCTION
Expand All @@ -17,6 +20,9 @@ GOTO DONE
:DEVELOPMENT
set NODE_ENV=development
GOTO BUILD
:MOBILE
set NODE_ENV=mobile
GOTO BUILD
:PRODUCTION
set NODE_ENV=production
GOTO BUILD
Expand Down
44 changes: 17 additions & 27 deletions js/app.i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
var cultures = app.cultures = app.cultures || {};
var LOADED = 'i18n.loaded';
var LANGUAGE = 'language';
var UNDEFINED = 'undefined';
var STRING = 'string';
var ARRAY = 'array';

Expand Down Expand Up @@ -115,38 +114,29 @@
* Load page locale (read from html tag)
*/
$(function () {
function fireLoaded() {
// Log readiness
logger.debug({
message: locale + ' locale loaded',
method: 'document.ready'
});
// trigger event for client localization of page
$(document).trigger(LOADED);
}
var locale = i18n.locale();

// Wait until locale is loaded to localize and hide preload
// @see http://blogs.telerik.com/kendoui/posts/11-10-06/foujui_flash_of_uninitialized_javascript_ui
$(document)
.one(LOADED, function () {
$(document).data(LOADED, true); // This way, we know it has already fired (see app.mobile)
$('body>div.k-loading-image').delay(400).fadeOut();
});

// Load locale and trigger event
i18n.load(locale)
.then(function () {
if ($.type(window.cordova) === UNDEFINED) {
fireLoaded()
} else {
// only fire after device is ready
document.addEventListener('deviceready', fireLoaded, false);
}
// Log readiness
logger.debug({
message: locale + ' locale loaded',
method: 'document.ready'
});
// trigger event for localization
$(document).trigger(LOADED);
});
});

/**
* Wait until locale is loaded to localize and hide preload
* @see http://blogs.telerik.com/kendoui/posts/11-10-06/foujui_flash_of_uninitialized_javascript_ui
*/
$(document)
.on(LOADED, function () {
if ($.type(window.cordova) === UNDEFINED) {
$('body>div.k-loading-image').delay(400).fadeOut();
}
});


}(window.jQuery));

Expand Down
7 changes: 0 additions & 7 deletions styles/app.page.common.less
Original file line number Diff line number Diff line change
Expand Up @@ -274,13 +274,6 @@ label {
}
}
}
//--------------------------------------------
// TODO: review whether iPad misaligned thumbnails are fixed
.k-content {
div.thumbnail {
box-sizing: border-box;
}
}
//---------------------------------------------
// Draggable/Sortable panels
.panel {
Expand Down

0 comments on commit c84383e

Please sign in to comment.