How to use the lively.lang.arr.last function in lively

To help you get started, we’ve selected a few lively 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 LivelyKernel / lively.morphic / text / input-line.js View on Github external
addInputToHistory(input) {
    var hist = this.inputHistory,
        items = hist.items;
    if (arr.last(items) === input) return;
    items.push(input);
    if (items.length > hist.max) {
      hist.items = items = items.slice(-hist.max);
    }
    hist.index = items.length - 1;
    if (!this.allowDuplicatesInHistory) {
      for (var i = hist.items.length-1; i--; )
        if (hist.items[i] === input) {
          hist.items.splice(i, 1); hist.index--; }
    }
    this.historyId && this.constructor.addHistoryToLocalStorage(this.historyId, hist);
  }
github LivelyKernel / lively.morphic / components / window.js View on Github external
close() {
    var world = this.world();
    this.deactivate();
    this.remove();

    var next = world.activeWindow() || arr.last(world.getWindows());
    next && next.activate();

    signal(this, "windowClosed", this);
    if (this.targetMorph && typeof this.targetMorph.onWindowClose === "function")
      this.targetMorph.onWindowClose();
  }
github LivelyKernel / lively.morphic / components / window.js View on Github external
isActive() {
    var w = this.world();
    if (!w) return false;
    if (this.titleLabel().fontWeight != "bold") return false;
    return arr.last(w.getWindows()) === this;
  }
github LivelyKernel / lively.next / lively.ide / html / navigator.js View on Github external
_backwardUpSexp(ed, fromIndex) {
    let ast = ed.editorPlugin.parse(),
        node = arr.last(nodesAt(fromIndex, ast).slice(0, -1));
    return (node && node.__location.startOffset) || fromIndex;
  }

lively

Express-like AWS Lamba framework

Apache-2.0
Latest version published 9 years ago

Package Health Score

40 / 100
Full package analysis