Skip to content

Commit

Permalink
stop using depreciated document.createEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
ttyridal committed Aug 8, 2016
1 parent e4c108f commit 188dccc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
9 changes: 5 additions & 4 deletions ext/data/config-cs.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ window.addEventListener("masterpassword-siteupdate", function(event) {
}, false);

self.port.on("configload", function (d) {
var e = document.createEvent('CustomEvent');
var cloned = cloneInto(d, document.defaultView);
e.initCustomEvent("masterpassword-configload", true, true, cloned);
document.documentElement.dispatchEvent(e);
document.documentElement.dispatchEvent(
new CustomEvent('masterpassword-configload', {
detail: cloneInto(d, document.defaultView),
bubbles: true
}));
});

self.port.emit('configload', 'lots of fun');
5 changes: 2 additions & 3 deletions ext/data/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@ function string_is_plain_ascii(s) {
alg_min_version = 1;

function save_sites_to_backend() {
var event = document.createEvent('CustomEvent');
event.initCustomEvent("masterpassword-siteupdate", true, true, stored_sites);
document.documentElement.dispatchEvent(event);
document.documentElement.dispatchEvent(
new CustomEvent('masterpassword-siteupdate', {detail:stored_sites, bubbles: true}));
}

function passtype_to_str(type) {
Expand Down

0 comments on commit 188dccc

Please sign in to comment.