How to use the etch.initialize function in etch

To help you get started, we’ve selected a few etch examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ioquatix / script-runner / lib / script-runner-view.js View on Github external
constructor(uri, title) {
		Etch.initialize(this);
		console.log("element", this.element);
		
		this.uri = uri;
		
		this.emitter = new Emitter;
		
		atom.commands.add(this.element, {
			'script-runner:copy': () => this.copyToClipboard(),
			'script-runner:paste': () => this.pasteToTerminal(),
			'script-runner:clear': () => this.clear(),
			'script-runner:interrupt': event => this.kill('SIGINT'),
			'script-runner:terminate': event => this.kill('SIGTERM'),
			'script-runner:kill': event => this.kill('SIGKILL'),
		});
		
		if (title == null)
github atom / github / lib / git / commit-box / commit-box-component.js View on Github external
acceptProps ({viewModel}: CommitBoxComponentProps): Promise {
    this.viewModel = viewModel

    let updatePromise = Promise.resolve()
    if (this.element) {
      updatePromise = etch.update(this)
    } else {
      etch.initialize(this)
      this.listener = new DOMListener(this.element)
    }

    if (this.subscriptions) this.subscriptions.dispose()
    this.subscriptions = new CompositeDisposable()
    this.subscriptions.add(this.listener.add('.git-CommitBox-button', 'click', () => this.commit()))

    this.subscriptions.add(atom.commands.add(this.element, {
      'git:commit': () => this.commit()
    }))

    this.subscriptions.add(atom.commands.add('atom-workspace', {
      'git:focus-commit-message': () => this.focus(),
      'git:focus-commit-button': () => this.focusCommitButton()
    }))
github atom / github / lib / views / merge-conflict-list-item-view.js View on Github external
constructor(props) {
    this.props = props;
    etch.initialize(this);
    this.props.registerItemElement(this.props.mergeConflict, this.element);
  }
github lukemurray / data-atom / lib / views / new-connection-dialog.js View on Github external
constructor(onConnect) {
    this.onConnectClicked = onConnect;

    this.loadedConnections = [];
    this.placeholderUrlPart = '://user:pass@localhost/db-name';
    this.supportedDbs = DbFactory.getSupportedDatabases();

    this.state = {
      selectedProtocol: this.supportedDbs[0].prefix,
      defaultPort: this.supportedDbs[0].port
    };

    etch.initialize(this);
    this.registerListeners();

    this.subscriptions = new CompositeDisposable();
    this.subscriptions.add(
      atom.commands.add(this.element, {
      'core:close': () => { this.close(); },
      'core:cancel': () => { this.close(); }
    }));

    DbFactory.loadConnections().then(connections => {
      this.loadedConnections = connections;
      etch.update(this);
    });
  }
github appcelerator / atom-appcelerator-titanium / lib / ui / console.jsx View on Github external
constructor(opts) {
		this.children = [];
		this.autoScroll = opts.autoScroll;
		etch.initialize(this);
	}
github atom / teletype / lib / popover-component.js View on Github external
constructor (props) {
    this.props = props
    if (this.props.authenticationProvider) {
      this.props.authenticationProvider.onDidChange(() => { this.update() })
    }
    etch.initialize(this)
  }
github atom / find-and-replace / lib / project / match-view.js View on Github external
constructor({match, regex, replacePattern, isSelected, previewStyle, top}) {
    this.match = match;
    this.regex = regex;
    this.replacePattern = replacePattern;
    this.previewStyle = previewStyle;
    this.isSelected = isSelected;
    this.top = top;
    etch.initialize(this);
  }
github atom / github / lib / views / staging-view.js View on Github external
this.debouncedDidChangeSelectedItem = debounce(this.didChangeSelectedItems, value);
      }
    });
    this.mouseSelectionInProgress = false;
    this.listElementsByItem = new WeakMap();
    this.mouseSelection = {started: false, dragged: false};

    this.selection = new CompositeListSelection({
      listsByKey: {
        unstaged: this.props.unstagedChanges,
        conflicts: this.props.mergeConflicts || [],
        staged: this.props.stagedChanges,
      },
      idForItem: item => item.filePath,
    });
    etch.initialize(this);

    this.subscriptions = new CompositeDisposable();
    this.subscriptions.add(this.props.commandRegistry.add(this.element, {
      'core:move-up': () => this.selectPrevious(),
      'core:move-down': () => this.selectNext(),
      'core:move-left': () => this.diveIntoSelection(),
      'core:select-up': () => this.selectPrevious(true),
      'core:select-down': () => this.selectNext(true),
      'core:select-all': () => this.selectAll(),
      'core:move-to-top': () => this.selectFirst(),
      'core:move-to-bottom': () => this.selectLast(),
      'core:select-to-top': () => this.selectFirst(true),
      'core:select-to-bottom': () => this.selectLast(true),
      'core:confirm': () => this.confirmSelectedItems(),
      'github:activate-next-list': () => this.activateNextList(),
      'github:activate-previous-list': () => this.activatePreviousList(),
github atom / find-and-replace / lib / find-view.js View on Github external
constructor(model, {findBuffer, replaceBuffer, findHistoryCycler, replaceHistoryCycler} = {}) {
    this.model = model;
    this.findBuffer = findBuffer;
    this.replaceBuffer = replaceBuffer;
    this.findHistoryCycler = findHistoryCycler;
    this.replaceHistoryCycler = replaceHistoryCycler;
    this.subscriptions = new CompositeDisposable();

    etch.initialize(this)

    this.findHistoryCycler.addEditorElement(this.findEditor.getElement());
    this.replaceHistoryCycler.addEditorElement(this.replaceEditor.getElement());
    this.handleEvents();
    this.clearMessage();
    this.updateOptionViews();
    this.updateSyntaxHighlighting();
    this.updateFindEnablement();
    this.updateReplaceEnablement();
    this.createWrapIcon();
  }
github danielbrodin / atom-project-manager / lib / views / EditView.js View on Github external
constructor(props, children) {
    this.props = props;
    this.children = children;
    etch.initialize(this);

    this.storeFocusedElement();

    this.element.addEventListener('click', (event) => {
      if (event.target === this.refs.save) {
        this.saveProject();
      }
    });

    disposables.add(atom.commands.add(this.element, {
      'core:save': () => this.saveProject(),
      'core:confirm': () => this.saveProject(),
    }));

    disposables.add(atom.commands.add('atom-workspace', {
      'core:cancel': () => this.close(),

etch

Perform virtual DOM updates based on changes to a data model.

MIT
Latest version published 4 years ago

Package Health Score

51 / 100
Full package analysis