Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@kevinchappell
Forked from phpdevelopernk-git/track.js
Created November 2, 2018 23:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevinchappell/c5a05ea77e9e8b6b3303dd28521f7d53 to your computer and use it in GitHub Desktop.
Save kevinchappell/c5a05ea77e9e8b6b3303dd28521f7d53 to your computer and use it in GitHub Desktop.
/**
* Track class
*/
// configure the class for runtime loading
if (!window.fbControls) window.fbControls = []
window.fbControls.push(function(controlClass) {
/**
* Track class
*/
class controlTrack extends controlClass {
/**
* Class configuration - return the icons & label related to this control
* @returndefinition object
*/
static get definition() {
return {
icon: 'T',
i18n: {
default: 'Track',
},
}
}
/**
* javascript & css to load
*/
configure() {}
/**
* build a text DOM element, supporting other jquery text form-control's
* @return {Object} DOM Element to be injected into the form.
*/
build() {
this.dom = this.markup('span', null, { id: this.config.name })
return this.dom
}
/**
* onRender callback
*/
onRender() {
this.dom.appendChild(this.markup('img', null, { src: 'https://formbuilder.online/assets/img/fb-logo.svg' }))
}
}
// register this control for the following types & text subtypes
controlClass.register('track', controlTrack)
return controlTrack
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment