MAMABA / editstrap

Make editable field using jquery and bootstrap
http://www.editstrap.com
12 stars 1 forks source link

Provide option to indicate size of form control to use rather than hard-coded input-group-sm #40

Open djpentz opened 7 years ago

djpentz commented 7 years ago

In your getHtml() function, you have: s = t('<div class="input-group input-group-sm select2-bootstrap-append select2-bootstrap-prepend edit-form" ></div>');

It would be nice if the input group size was one of the options available, as in one example I want the control to be larger (input-group-lg) but can't as a result of the input-group-sm hard-coding.

mhulse commented 7 years ago

My fix was to remove all code references to -sm. I just wanted normal size inputs.

+1 for a var that sets this. Or callbacks that allow modification of the getHtml() method (pre and post hooks like: onBeforeGetHtml and onAfterGetHtml).

See #42

mhulse commented 7 years ago

Ended up adding a callback rather than removing from the source code. See:

https://github.com/MAMABA/editstrap/issues/42#issuecomment-320362270

In your case, if you add this callback into the code, you could do:

html.removeClass('input-group-sm').addClass('input-group-lg');