From ab4a5398b4a17c416d07f4a7b8e07fa79617fd88 Mon Sep 17 00:00:00 2001 From: cTn Date: Wed, 26 Feb 2014 07:09:53 +0100 Subject: [PATCH] adding flash on connect UI, backend missing --- tabs/firmware_flasher.css | 3 +++ tabs/firmware_flasher.html | 3 ++- tabs/firmware_flasher.js | 13 +++++++++++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/tabs/firmware_flasher.css b/tabs/firmware_flasher.css index 25fb376c..3918e2c1 100644 --- a/tabs/firmware_flasher.css +++ b/tabs/firmware_flasher.css @@ -33,6 +33,9 @@ float: left; margin-top: 2px; } + .tab-firmware_flasher .note .flash_on_connect_wrapper { + display: none; + } a.load_file, a.load_remote_file { display: block; float: left; diff --git a/tabs/firmware_flasher.html b/tabs/firmware_flasher.html index 616774ee..4f3b1570 100644 --- a/tabs/firmware_flasher.html +++ b/tabs/firmware_flasher.html @@ -10,7 +10,8 @@ If you are flashing board with baseflight already flashed (updating), leave this checkbox unchecked.
If you are flashing "bare" board with no firmware preloaded or you have bootloader pins shorted, check this box.

- +
+
Load Firmware [Local] diff --git a/tabs/firmware_flasher.js b/tabs/firmware_flasher.js index b7646bf8..d19c53e4 100644 --- a/tabs/firmware_flasher.js +++ b/tabs/firmware_flasher.js @@ -107,14 +107,23 @@ function tab_initialize_firmware_flasher() { } else { if (result.no_reboot_sequence) { $('input.updating').prop('checked', true); + $('label.flash_on_connect_wrapper').show(); } else { $('input.updating').prop('checked', false); } } // bind UI hook so the status is saved on change - $('input.updating').change(function() { - chrome.storage.local.set({'no_reboot_sequence': $(this).is(':checked')}, function() {}); + $('input.updating').change(function() { + var status = $(this).is(':checked'); + + if (status) { + $('label.flash_on_connect_wrapper').show(); + } else { + $('label.flash_on_connect_wrapper').hide(); + } + + chrome.storage.local.set({'no_reboot_sequence': status}, function() {}); }); });