From c233db3fc8ca7666326b2930c246d9b05115abb1 Mon Sep 17 00:00:00 2001 From: Volodymyr Moskalyk Date: Sat, 14 Oct 2017 18:20:12 +0200 Subject: [PATCH] Enable/Disable all button for OSD screen --- _locales/en/messages.json | 3 +++ tabs/osd.css | 4 ++++ tabs/osd.html | 8 +++++++- tabs/osd.js | 6 ++++++ 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 810c6c81..701d67ee 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -2309,6 +2309,9 @@ "osdSetupElementsTitle": { "message": "Elements" }, + "osdSetupElementsSwitchAll": { + "message": "Switch all" + }, "osdSetupPreviewTitle": { "message": "Preview (drag to change position)" }, diff --git a/tabs/osd.css b/tabs/osd.css index 58148fd2..30938075 100644 --- a/tabs/osd.css +++ b/tabs/osd.css @@ -316,6 +316,10 @@ background: rgba(255,255,255,0.4); } +.tab-osd .switch-all-elements { + float: right; +} + .tab-osd .preview .char[draggable="true"] { cursor: move; } diff --git a/tabs/osd.html b/tabs/osd.html index f9cf7c4d..a76b724d 100755 --- a/tabs/osd.html +++ b/tabs/osd.html @@ -18,7 +18,13 @@
-
+
+ + + + + +
diff --git a/tabs/osd.js b/tabs/osd.js index d8bef885..b3c7002d 100755 --- a/tabs/osd.js +++ b/tabs/osd.js @@ -1532,6 +1532,12 @@ TABS.osd.initialize = function (callback) { } }); + //Switch all elements + $('input#switch-all').change(function () { + var new_state = $(this).is(':checked'); + $('#element-fields input[type=checkbox]').prop('checked', new_state).change(); + }) + $(document).on('click', 'span.progressLabel a.save_font', function () { chrome.fileSystem.chooseEntry({type: 'saveFile', suggestedName: 'baseflight', accepts: [{extensions: ['mcm']}]}, function (fileEntry) { if (chrome.runtime.lastError) {