Picture of Kevin Jones
Re: Developing new component/extension/plugin
by Kevin Jones - Thursday, 18 September 2014, 9:46 AM
 

What he said :)

Perhaps you could take the text input component but then borrow code from the image component to create your own. I borrowed from one of the contribs when i did one. The order i ended up working (good or bad) :

Handlebars (View): Add the image component's handlebar code to the textinput, sort out your css for it so that it will sit however you envision it at the different widths.

Styles : (make sure the styles for the image are in your components LESS files)

JSON (Model) : Bring in the JSON code that was in the image component into your textinputImageReveal component.

Code (Controller): Make sure your image starts off invisible, runs it original code in the functions that are probably in TextInput e.g. PreRender, PostRender etc.. there are a bunch they inherit from the core component they extend. Check which they share and which you might need to add..  Then trigger the 'show' on the submit button etc....

Getting it to all work on one size (desktop) first is probably a good idea, then you will spend a little time getting the CSS right at the different breakpoints :)

K