1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-14 20:10:11 +03:00

CSS fixups

This commit is contained in:
U-PAWEL-X220\pawel 2017-01-01 21:18:02 +01:00
parent c569913baa
commit 2ed44f34b1
3 changed files with 305 additions and 372 deletions

41
main.js
View file

@ -1,4 +1,4 @@
/*global $, chrome*/
/*global $, chrome, analytics*/
'use strict';
// Google Analytics
@ -9,6 +9,8 @@ googleAnalyticsService.getConfig().addCallback(function (config) {
googleAnalyticsConfig = config;
});
chrome.storage = chrome.storage || {};
$(document).ready(function () {
// translate to user-selected language
localize();
@ -190,7 +192,7 @@ $(document).ready(function () {
$('#tabs ul.mode-disconnected li a:first').click();
// options
$('a#options').click(function () {
$('#options').click(function () {
var el = $(this);
if (!el.hasClass('active')) {
@ -246,8 +248,10 @@ $(document).ready(function () {
}
});
var $content = $("#content");
// listen to all input change events and adjust the value within limits if necessary
$("#content").on('focus', 'input[type="number"]', function () {
$content.on('focus', 'input[type="number"]', function () {
var element = $(this),
val = element.val();
@ -256,7 +260,7 @@ $(document).ready(function () {
}
});
$("#content").on('keydown', 'input[type="number"]', function (e) {
$content.on('keydown', 'input[type="number"]', function (e) {
// whitelist all that we need for numeric control
var whitelist = [
96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, // numpad and standard number keypad
@ -271,7 +275,7 @@ $(document).ready(function () {
}
});
$("#content").on('change', 'input[type="number"]', function () {
$content.on('change', 'input[type="number"]', function () {
var element = $(this),
min = parseFloat(element.prop('min')),
max = parseFloat(element.prop('max')),
@ -322,13 +326,16 @@ $(document).ready(function () {
});
$("#showlog").on('click', function() {
var state = $(this).data('state');
if ( state ) {
$("#log").animate({height: 27}, 200, function() {
var state = $(this).data('state'),
$log = $("#log");
if (state) {
$log.animate({height: 27}, 200, function() {
var command_log = $('div#log');
command_log.scrollTop($('div.wrapper', command_log).height());
//noinspection JSValidateTypes
command_log.scrollTop($('div.wrapper', command_log).height());
});
$("#log").removeClass('active');
$log.removeClass('active');
$("#content").removeClass('logopen');
$(".tab_container").removeClass('logopen');
$("#scrollicon").removeClass('active');
@ -336,8 +343,8 @@ $(document).ready(function () {
state = false;
}else{
$("#log").animate({height: 111}, 200);
$("#log").addClass('active');
$log.animate({height: 111}, 200);
$log.addClass('active');
$("#content").addClass('logopen');
$(".tab_container").addClass('logopen');
$("#scrollicon").addClass('active');
@ -368,16 +375,8 @@ function catch_startup_time(startTime) {
googleAnalytics.sendTiming('Load Times', 'Application Startup', timeSpent);
}
function microtime() {
var now = new Date().getTime() / 1000;
return now;
}
function millitime() {
var now = new Date().getTime();
return now;
return new Date().getTime();
}
function bytesToSize(bytes) {