content/static: fix unit page type error

Makes expandAll toggle for ExpandableRowsTableController
optional to fix a type error in unit.ts

For golang/go#43359

Change-Id: I5680283ea71d0aabde3511c76ac8ee39ab288905
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/299257
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Jamal Carvalho 2021-03-05 16:01:50 -05:00
Родитель d8cbc4f9d7
Коммит bc3f77d9ae
2 изменённых файлов: 2 добавлений и 6 удалений

Просмотреть файл

@ -1 +1 @@
{"version":3,"file":"table.js","sourceRoot":"","sources":["table.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAeH,MAAM,OAAO,6BAA6B;IASxC,YAAY,KAAuB,EAAE,SAA6B;QAChE,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,gBAAgB,CAAsB,sBAAsB,CAAC,CAAC;QACnF,IAAI,CAAC,aAAa,EAAE,CAAC;QACrB,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAC5B,IAAI,CAAC,kBAAkB,EAAE,CAAC;IAC5B,CAAC;IAMO,aAAa;QACnB,KAAK,MAAM,CAAC,IAAI,CAAC,oBAAoB,EAAE,sBAAsB,EAAE,SAAS,CAAC,EAAE;YACzE,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;;gBAChD,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,QAAE,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,mCAAI,EAAE,CAAC,CAAC;gBAChE,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;YACvB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CAAC,uBAAD,CAAC,CAAE,YAAY,CAAC,eAAe,2CAAG,OAAO,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;YACtE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,CAAC,EAAE,CAAC,EAAE;gBACnB,MAAM,MAAM,GAAG,QAAQ,CAAC,cAAc,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;gBAChD,IAAI,UAAU,EAAE;oBACd,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,SAAS,CAAC,GAAG,CAAC,SAAS,EAAE;oBACjC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,SAAS,CAAC,MAAM,CAAC,QAAQ,EAAE;iBACpC;qBAAM;oBACL,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,SAAS,CAAC,GAAG,CAAC,QAAQ,EAAE;oBAChC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,SAAS,CAAC,MAAM,CAAC,SAAS,EAAE;iBACrC;YACH,CAAC,EAAE;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}

Просмотреть файл

@ -19,17 +19,13 @@
* ```
*/
export class ExpandableRowsTableController {
private table: HTMLTableElement;
private expandAll?: HTMLButtonElement;
private toggles: NodeListOf<HTMLTableRowElement>;
/**
* Create a table controller.
* @param table - The table element to which the controller binds.
*/
constructor(table: HTMLTableElement, expandAll?: HTMLButtonElement) {
this.table = table;
this.expandAll = expandAll;
constructor(private table: HTMLTableElement, private expandAll?: HTMLButtonElement | null) {
this.toggles = table.querySelectorAll<HTMLTableRowElement>('[data-aria-controls]');
this.setAttributes();
this.attachEventListeners();