Skip to content
Snippets Groups Projects
Commit aba62236 authored by CupCakeArmy's avatar CupCakeArmy
Browse files

Escaping possible errors

parent 60ed9234
No related branches found
No related tags found
No related merge requests found
...@@ -80,7 +80,6 @@ var tools = { ...@@ -80,7 +80,6 @@ var tools = {
} }
}).done(function(data) { }).done(function(data) {
$('#main-content').html(data); $('#main-content').html(data);
tools.ui.resizeTool();
$('#main-content').fadeIn(250, function() { $('#main-content').fadeIn(250, function() {
$('#wheel-logo').css('transform', 'rotate(0deg)'); $('#wheel-logo').css('transform', 'rotate(0deg)');
}); });
...@@ -105,7 +104,7 @@ var tools = { ...@@ -105,7 +104,7 @@ var tools = {
}); });
}, },
resizeTool: function() { resizeTool: function() {
$('tools-full-height').height($(window).height() - $('.navbar-main').height()); $('.wrapper-content').height($(window).height() - $('.navbar-main').height());
}, },
menuId: 0, menuId: 0,
menu: function(attr) { menu: function(attr) {
...@@ -162,6 +161,10 @@ $.ajaxSetup({ ...@@ -162,6 +161,10 @@ $.ajaxSetup({
//Binding tool change whenever the hash is changed //Binding tool change whenever the hash is changed
window.onhashchange = tools.getTool; window.onhashchange = tools.getTool;
//Resizing Body when menu changes size and calling it on ready
window.onresize = tools.ui.resizeTool;
// Login function // Login function
function loginFunc() { function loginFunc() {
$('.loginPanel input').attr('readonly', 1); $('.loginPanel input').attr('readonly', 1);
...@@ -177,16 +180,22 @@ function loginFunc() { ...@@ -177,16 +180,22 @@ function loginFunc() {
}); });
} }
// Binding the buttons // When document loaded
$('.toggleSidebarBtn').click(tools.ui.toggleSideMenu); $(document).ready(function() {
$('.loginAction').click(loginFunc); // Resizing main wrapper-main
$('.logoutAction').click(amivcore.logout); tools.ui.resizeTool();
$('.loginPanel').keypress(function(e) {
if (e.which == 13) { // Binding the buttons
e.preventDefault(); $('.toggleSidebarBtn').click(tools.ui.toggleSideMenu);
loginFunc(); $('.loginAction').click(loginFunc);
} $('.logoutAction').click(amivcore.logout);
}) $('.loginPanel').keypress(function(e) {
if (e.which == 13) {
e.preventDefault();
loginFunc();
}
});
});
amivcore.on('ready', function() { amivcore.on('ready', function() {
tools.getTool(); tools.getTool();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment