mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-01-24 16:19:20 +01:00
Update the core module to implement the style guidelines. Reduce size of init.js - moved filter logic out to it's own config. Rename Menus to menuService
46 lines
1.4 KiB
JavaScript
46 lines
1.4 KiB
JavaScript
(function (app) {
|
|
'use strict';
|
|
|
|
// Start by defining the main module and adding the module dependencies
|
|
angular
|
|
.module(app.applicationModuleName, app.applicationModuleVendorDependencies);
|
|
|
|
// Setting HTML5 Location Mode
|
|
angular
|
|
.module(app.applicationModuleName)
|
|
.config(bootstrapConfig);
|
|
|
|
function bootstrapConfig($locationProvider, $httpProvider) {
|
|
$locationProvider.html5Mode(true).hashPrefix('!');
|
|
|
|
$httpProvider.interceptors.push('authInterceptor');
|
|
}
|
|
|
|
bootstrapConfig.$inject = ['$locationProvider', '$httpProvider'];
|
|
|
|
// Then define the init function for starting up the application
|
|
angular.element(document).ready(init);
|
|
|
|
function init() {
|
|
// Fixing facebook bug with redirect
|
|
if (window.location.hash && window.location.hash === '#_=_') {
|
|
if (window.history && history.pushState) {
|
|
window.history.pushState('', document.title, window.location.pathname);
|
|
} else {
|
|
// Prevent scrolling by storing the page's current scroll offset
|
|
var scroll = {
|
|
top: document.body.scrollTop,
|
|
left: document.body.scrollLeft
|
|
};
|
|
window.location.hash = '';
|
|
// Restore the scroll offset, should be flicker free
|
|
document.body.scrollTop = scroll.top;
|
|
document.body.scrollLeft = scroll.left;
|
|
}
|
|
}
|
|
|
|
// Then init the app
|
|
angular.bootstrap(document, [app.applicationModuleName]);
|
|
}
|
|
}(ApplicationConfiguration));
|