mail/src/mobile.js

35 lines
780 B
JavaScript
Raw Normal View History

2013-06-10 21:14:57 -04:00
require(['require-config'], function() {
'use strict';
2013-06-10 21:14:57 -04:00
// Start the main app logic.
require(['jquery', 'backbone', 'js/app-controller', 'js/app-router',
'js/app-config'
], function($, Backbone, controller, Router, app) {
2013-06-10 21:14:57 -04:00
var router;
/**
* Load templates and start the application
*/
$(document).ready(function() {
controller.init(function() {
controller.start(startApp);
});
});
2013-06-10 21:14:57 -04:00
function startApp() {
// start backone.js router
router = new Router();
Backbone.history.start();
}
2013-06-10 21:14:57 -04:00
/**
* Helper method shim to ease message posting between sandbox and main window
*/
app.util.postMessage = function(cmd, args, callback) {
// handle the workload in the main window
controller.execute(cmd, args, callback);
};
2013-06-10 21:14:57 -04:00
});
});