Fixes BS3 support

- Added a inline-form element to show the button next to it
- Moved helper functions into the scope of the function
- Added a preventDefault so it wont submit the form