-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
39 additions
and
4 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
ckanext/datagovtheme/fanstatic_library/scripts/contactform.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
jQuery(function ($) { | ||
const tpform_id = "fd986495"; | ||
const tpform_js = "https://touchpoints.app.cloud.gov/touchpoints/"+tpform_id+".js"; | ||
|
||
// load external touchpoint js script | ||
$.getScript(tpform_js, function () { | ||
console.log( "Touchpoint form is loaded." ); | ||
set_form(); | ||
}); | ||
|
||
function set_form() { | ||
// unhide the button and set the click event | ||
$("#contact-btn").css('visibility', 'inherit').click(function () { | ||
// change the form location_code value | ||
if ($('article[data-package-name]')) { | ||
const dataset_name = $('article[data-package-name]').attr('data-package-name'); | ||
$("#fba_location_code").val(dataset_name); | ||
$("#answer_04").val(dataset_name); | ||
} | ||
}); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters