for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
class NodeForm {
/**
* @param {string} formID id of the respective form element
*
* @return {void}
*/
constructor(formID) {
this.$form = jQuery(`#${formID}`);
this.$form.find('[name="cancel-button"]').on('click', this.hide.bind(this));
}
* Show this form in a jQueryUI dialog
show() {
this.$form.dialog({
title: this.name,
width: 600,
});
* Hide this form/dialog
hide() {
jQuery(this.$form).dialog('close');
* Bind a callback to an event on the form
* @param {string} eventName name of the event, can contain namespaces (e.g. click.myPlugin )
* @param {function} callback the handler function to be attached to the event
on(eventName, callback) {
this.$form.on(eventName, callback);
* Remove a handler from an event
off(eventName) {
this.$form.off(eventName);
export default NodeForm;