Created
February 23, 2018 08:42
-
-
Save phpdevelopernk-git/18841590ac1b0e95bdd4effc32b8abdb to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/** | |
* 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() { | |
return this.markup('span', null, {id: this.config.name}); | |
} | |
/** | |
* onRender callback | |
*/ | |
onRender() { | |
$("#build-wrap .track-field[type='track']").append('<img src="my_image_path"/>'); | |
} | |
} | |
// 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