Files
pathfinder/js/app/setup.js
Exodus4D c393e79c76 - added "static" wormholes for "shattered" systems , closed #180
- added im/export function for "index" tables (*.csv import), as an alternative to the *.sql import, closed #125
2016-07-16 20:08:27 +02:00

55 lines
1.4 KiB
JavaScript

/**
* Main setupPage application
*/
define([
'jquery',
'app/init',
'app/util'
], function($, Init, Util) {
'use strict';
var config = {
splashOverlayClass: 'pf-splash' // class for "splash" overlay
};
/**
* set page observer
*/
var setPageObserver = function(){
var body = $('body');
// collapse ---------------------------------------
body.find('[data-toggle="collapse"]').css({cursor: 'pointer'}).on('click', function(){
$(this).find('.pf-animate-rotate').toggleClass('right');
});
// buttons ----------------------------------------
// exclude "download" buttons
body.find('.btn').not('[href^="?export"]').on('click', function(e){
$('.' + config.splashOverlayClass).showSplashOverlay();
});
// tooltips ---------------------------------------
body.initTooltips();
// change url (remove logout parameter)
if (history.pushState) {
history.pushState({}, '', location.protocol + '//' + location.host + location.pathname);
}
};
/**
* main init "setup" page
*/
$(function(){
// show app information in browser console --------
Util.showVersionInfo();
// hide splash loading animation ------------------
$('.' + config.splashOverlayClass).hideSplashOverlay();
setPageObserver();
});
});