custom-inputs.ext.js 558 B

12345678910111213141516171819202122232425262728293031323334
  1. require('./idealfile');
  2. require('./idealradiocheck');
  3. module.exports = {
  4. name: 'customInputs',
  5. options: {
  6. customInputs: {
  7. i18n: {
  8. open: 'Open'
  9. }
  10. }
  11. },
  12. methods: {
  13. // @extend
  14. _init: function() {
  15. this._buildCustomInputs();
  16. },
  17. // @extend
  18. 'addFields:after': function() {
  19. this._buildCustomInputs();
  20. },
  21. _buildCustomInputs: function() {
  22. this.$form.find(':file').idealfile(this.opts.customInputs.i18n);
  23. this.$form.find(':checkbox, :radio').idealradiocheck();
  24. }
  25. }
  26. };