Skip to content

Commit 4653871

Browse files
committed
fixing example js and initialized shareurl button event
1 parent 1e871e4 commit 4653871

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

example.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,5 @@ document.addEventListener('DOMContentLoaded', () => {
5555
// }
5656

5757
// Initialize and populate sticky form.
58-
window.urlformjs.Init(FormParameters, FormOptions);
59-
window.urlformjs.PopulateFromURI();
58+
URLForm.PopulateFromURI(URLForm.Init(FormParameters, FormOptions));
6059
});

urlform.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -279,13 +279,13 @@ function Init(params, formOptions) {
279279
formOpt.FormParameters = params
280280
formOpt.ShareURLBtnElement = document.querySelector(formOpt.shareURLBtn);
281281
if (formOpt.ShareURLBtnElement != null) {
282-
formOpt.ShareURLBtnElement.addEventListener('click', () => shareURI()); // Must be anonymous, otherwise passes pointer event object.
282+
formOpt.ShareURLBtnElement.addEventListener('click', () => shareURI(formOpt)); // Must be anonymous, otherwise passes pointer event object.
283283
}
284284
formOpt.ClearBtnElement = document.querySelector(formOpt.clearBtn);
285285
if (formOpt.ClearBtnElement != null) {
286286
formOpt.ClearBtnElement.addEventListener('click', () => {
287-
Clear()
288-
shareURI();
287+
Clear(formOpt);
288+
shareURI(formOpt);
289289
});
290290
}
291291
if (!isEmpty(formOpt.formID)) {

0 commit comments

Comments
 (0)