Skip to content

Commit

Permalink
consent: write mode workarounds
Browse files Browse the repository at this point in the history
  • Loading branch information
kapouer committed Feb 13, 2020
1 parent ba0d8d2 commit b545942
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/google/ui/consent.css
Expand Up @@ -2,6 +2,7 @@
display:none;
}

[contenteditable] [block-type="consent_form"][data-transient="true"],
[block-type="consent_form"][data-transient="true"] > template {
display:block;
}
}
1 change: 1 addition & 0 deletions packages/google/ui/consent.js
Expand Up @@ -3,6 +3,7 @@ Page.ready(function(state) {
});
Page.getConsent = function(state) {
document.querySelectorAll('[block-type="consent_form"]').forEach((node) => {
if (!node.options) return;
if (node.options.transient) node.classList.add('visible');
HTMLCustomFormElement.prototype.fill.call(node, {
consent: state.scope.$consent
Expand Down
2 changes: 1 addition & 1 deletion packages/html/ui/consent.js
@@ -1,7 +1,7 @@
Page.setup(function(state) {
state.finish(() => {
var consent = Page.storage.get('consent');
if (consent === null && !Page.getConsent) {
if (consent === null && !Page.getConsent || state.scope.$write) {
consent = "yes";
}
state.scope.$consent = consent;
Expand Down

0 comments on commit b545942

Please sign in to comment.