Skip to content

Instantly share code, notes, and snippets.

@pardamike
Last active December 20, 2017 09:58
Show Gist options
  • Save pardamike/20c0fe073bbad2d8306112d78afc111c to your computer and use it in GitHub Desktop.
Save pardamike/20c0fe073bbad2d8306112d78afc111c to your computer and use it in GitHub Desktop.
<button type="button" id="clickMe1">Click me 1</button>
<button type="button" id="clickMe2">Click me 2</button>
<script>
(function () {
// No customization
var fbModal = $.fn.bootstrapFeedback({
getOptionsUrl: 'https://some.api/getOptions',
sendFeedbackUrl: 'https://some.api/postData',
targetElementId: 'clickMe1'
});
fbModal.init();
// Full customization:
var feedback = $.fn.bootstrapFeedback({
targetElementId: 'clickMe2',
getOptionsUrl: 'https://some.api/getOptions',
sendFeedbackUrl: 'https://some.api/postData',
styles: {
submitBtnClasses: 'btn btn-success',
closeBtnClasses: 'btn btn-danger'
},
modal: {
selectorId: 'anotherFeedbackModal',
title: 'Other Title',
subtitle: 'New Subtitle',
commentTxBxId: 'someTextbox',
radioGroupName: 'custom_radio_name',
radioGroupContainer: 'radioWrapper',
saveBtnId: 'saveMe',
notificationAreaId: 'notifyMe'
}
});
feedback.init();
})();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment