FileURLEditor.js 542 B

1234567891011121314151617181920212223242526272829
  1. import { StringInput, Element } from '../../libs/flow.module.js';
  2. import { BaseNode } from './BaseNode.js';
  3. import { DataFile } from './DataFile.js';
  4. export class FileURLEditor extends BaseNode {
  5. constructor() {
  6. const dataFile = new DataFile();
  7. super( 'File URL', 1, dataFile, 250 );
  8. const urlInput = new StringInput().onChange( () => {
  9. if ( urlInput.getValue() !== dataFile.getURL() ) {
  10. dataFile.setValue( urlInput.getValue() );
  11. this.invalidate();
  12. }
  13. } );
  14. this.add( new Element().add( urlInput ) );
  15. }
  16. }