Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/statistics-prompt-layout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ftw": patch
---

Keep the statistics and Cloud terms prompt readable by making it span the full Overview width.
10 changes: 9 additions & 1 deletion web/project-statistics.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,15 @@
status=v[0];policy=v[1];
if(!policy.cloud_includes_statistics || !policy.standalone)return;
var prompt=document.getElementById("project-statistics-prompt");
if(!prompt){prompt=node("section");prompt.id="project-statistics-prompt";prompt.setAttribute("aria-label","Project statistics choice");var main=document.querySelector("main")||document.body;main.insertBefore(prompt,main.firstChild);}
if(!prompt){
prompt=node("section");
prompt.id="project-statistics-prompt";
prompt.setAttribute("aria-label","Project statistics choice");
// The Overview grid has twelve columns; the prompt needs the whole row.
prompt.style.gridColumn="1 / -1";
var main=document.querySelector("main")||document.body;
main.insertBefore(prompt,main.firstChild);
}
paint(prompt,false);
document.querySelectorAll("[data-project-statistics-settings]").forEach(function(host){paint(host,true);});
}).catch(function(){});
Expand Down
2 changes: 1 addition & 1 deletion web/project-statistics.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {setImmediate} from 'node:timers/promises';
const source=readFileSync(new URL('./project-statistics.js',import.meta.url),'utf8');
function page(cloud=false,authorised=true) {
class Element {
constructor(tag){this.tag=tag;this.children=[];this.events={};this.ownText='';}
constructor(tag){this.tag=tag;this.children=[];this.events={};this.style={};this.ownText='';}
appendChild(e){this.children.push(e);return e;}
insertBefore(e){this.children.unshift(e);}
set textContent(v){this.ownText=v;this.children=[];}
Expand Down
Loading