We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6da7599 commit 3c930dbCopy full SHA for 3c930db
src/cards.ts
@@ -173,4 +173,15 @@ export class Cards extends Component<CardsOptions> implements Openable {
173
}
174
this._removeRevealCloseEventHandlers();
175
};
176
+
177
+ static Init() {
178
+ if (typeof document !== 'undefined')
179
+ // Handle initialization of static cards.
180
+ document.addEventListener('DOMContentLoaded', () => {
181
+ const cards = document.querySelectorAll('.card');
182
+ cards.forEach((el) => {
183
+ if (el && (el['M_Card'] == undefined)) this.init((el as HTMLElement));
184
+ });
185
186
+ }
187
src/index.ts
@@ -138,3 +138,4 @@ Forms.Init();
138
Chips.Init();
139
Waves.Init();
140
Range.Init();
141
+Cards.Init();
0 commit comments