Index: go-back-with-backspace/pages/options.js |
diff --git a/go-back-with-backspace/pages/options.js b/go-back-with-backspace/pages/options.js |
index 9ff25d65f1c7564e76834ea643093fd4fa7893ba..3d66b78d3004deef3b29f8238b8cdf46edcae0a7 100644 |
--- a/go-back-with-backspace/pages/options.js |
+++ b/go-back-with-backspace/pages/options.js |
@@ -2,9 +2,15 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
+// Disable the whitelist field when it's not relevant. |
+function updateEnabledInputs() { |
+ var checkbox = document.getElementById('disableInApplets'); |
+ document.getElementById('whitelist').disabled = !checkbox.checked; |
Devlin
2016/11/01 15:12:15
Suggestion: at the top of this file (or in common.
|
+} |
+ |
// Initialize the page. |
function init() { |
- LoadInternationalizedStrings(); |
+ loadInternationalizedStrings(); |
var blacklist = document.getElementById('blacklist'); |
var checkbox = document.getElementById('disableInApplets'); |
@@ -16,7 +22,7 @@ function init() { |
whitelist.maxlength = chrome.storage.sync.QUOTA_BYTES_PER_ITEM - 200; |
// Set event handlers. |
- document.getElementById('done_button').onclick = function() { |
+ document.getElementById('done-button').onclick = function() { |
chrome.storage.sync.set({ |
// Split the lists into arrays at whitespace before saving. |
blacklist: |
@@ -37,12 +43,14 @@ function init() { |
}); |
}; |
- document.getElementById('cancel_button').onclick = function() { |
+ checkbox.onchange = updateEnabledInputs; |
+ |
+ document.getElementById('cancel-button').onclick = function() { |
Devlin
2016/11/01 15:12:15
$('cancel-button').onclick = window.close;
|
window.close(); |
}; |
- document.getElementById('report_page').onclick = function() { |
- reportPage(); |
+ document.getElementById('feedback-link').onclick = function() { |
Devlin
2016/11/01 15:12:15
$('feedback-link').onclick = sendFeedback;
Pam (message me for reviews)
2016/11/01 21:29:03
This one doesn't work, because sendFeedback takes
|
+ sendFeedback(); |
}; |
// Load saved settings into the form fields. |
@@ -54,6 +62,8 @@ function init() { |
blacklist.value = items.blacklist.join('\n'); |
checkbox.checked = items.disableInApplets; |
whitelist.value = items.whitelist.join('\n'); |
+ |
+ updateEnabledInputs(); |
}); |
} |