Text.js 637 B

1234567891011121314151617181920212223
  1. Ext.define('Ext.theme.material.form.field.Text', {
  2. override: 'Ext.form.field.Text',
  3. labelSeparator: '',
  4. initComponent: function() {
  5. this.callParent();
  6. this.on({
  7. change: function(field, value) {
  8. if (field.el) {
  9. field.el.toggleCls('not-empty', !Ext.isEmpty(value) || field.emptyText);
  10. }
  11. },
  12. render: function(ths, width, height, eOpts) {
  13. if ((!Ext.isEmpty(ths.getValue()) || ths.emptyText) && ths.el) {
  14. ths.el.addCls('not-empty');
  15. }
  16. }
  17. });
  18. }
  19. });