()
| 1116 | this.html = html; |
| 1117 | } |
| 1118 | generateHTML(): HTMLElement { |
| 1119 | if (this.html instanceof Function) { |
| 1120 | return (this.html = this.html()); |
| 1121 | } else { |
| 1122 | return this.html; |
| 1123 | } |
| 1124 | } |
| 1125 | watchForChange() {} |
| 1126 | } |
| 1127 | /** |
| 1128 | * This is a simple wrapper class for Options to make it happy so it can be used outside of Settings. |
| 1129 | */ |
| 1130 | class Float { |
| 1131 | options: Options; |
| 1132 | html: WeakRef<HTMLElement> = new WeakRef(document.createElement("div")); |
| 1133 | /** |
| 1134 | * This is a simple wrapper class for Options to make it happy so it can be used outside of Settings. |
| 1135 | */ |
| 1136 | constructor(name: string, options = {ltr: false, noSubmit: true}) { |
| 1137 | this.options = new Options(name, this, options); |
| 1138 | } |
| 1139 | changed(d: HTMLElement) { |
| 1140 | const html = this.html.deref(); |
| 1141 | if (!html) return; |
| 1142 | html.append(d); |
| 1143 | } |
| 1144 | generateHTML() { |
| 1145 | const html = this.options.generateHTML(); |
| 1146 | this.html = new WeakRef(html); |
| 1147 | return html; |
| 1148 | } |
| 1149 | } |
| 1150 | class Dialog { |
| 1151 | float: Float; |
| 1152 | above = false; |
nothing calls this directly
no test coverage detected