Index: chrome/common/extensions/docs/examples/extensions/gmail/options.js |
diff --git a/chrome/common/extensions/docs/examples/extensions/gmail/options.js b/chrome/common/extensions/docs/examples/extensions/gmail/options.js |
index c862c6b301cfd66061fcd305fddd16c3aa578591..0514b7e0048635869c4d2e4f2e3e1b1676dc8b6c 100644 |
--- a/chrome/common/extensions/docs/examples/extensions/gmail/options.js |
+++ b/chrome/common/extensions/docs/examples/extensions/gmail/options.js |
@@ -4,10 +4,12 @@ |
var customDomainsTextbox; |
var saveButton; |
+var cancelButton; |
function init() { |
customDomainsTextbox = document.getElementById("custom-domain"); |
saveButton = document.getElementById("save-button"); |
+ cancelButton = document.getElementById("cancel-button"); |
customDomainsTextbox.value = localStorage.customDomain || ""; |
markClean(); |
@@ -16,8 +18,12 @@ function init() { |
function save() { |
localStorage.customDomain = customDomainsTextbox.value; |
not at google - send to devlin
2012/08/07 02:48:33
use storage.sync?
|
markClean(); |
- |
- chrome.extension.getBackgroundPage().init(); |
+ chrome.runtime.getBackgroundPage(function(backgroundPage) { |
+ backgroundPage.startRequest({ |
+ scheduleRequest:false, |
+ showLoadingAnimation:true |
+ }); |
+ }); |
} |
function markDirty() { |
@@ -30,8 +36,7 @@ function markClean() { |
document.addEventListener('DOMContentLoaded', function () { |
init(); |
- document.querySelector('#cancel-button').addEventListener('DOMContentLoaded', |
- init); |
- document.querySelector('#save-button').addEventListener('DOMContentLoaded', |
- save); |
+ saveButton.addEventListener('click', save); |
+ cancelButton.addEventListener('click', init); |
+ customDomainsTextbox.addEventListener('input', markDirty); |
}); |