Commit 8578d222 authored by Nicolas Chevobbe's avatar Nicolas Chevobbe
Browse files

Bug 1765748 - [devtools] Remove SplitView active summary getter and rename setter. r=ochameau.

parent d24de6a1
Loading
Loading
Loading
Loading
+3 −12
Original line number Diff line number Diff line
@@ -100,21 +100,12 @@ class SplitView {
    return this._root;
  }

  /**
   * Retrieve the active item's summary element or null if there is none.
   *
   * @return DOMElement
   */
  get activeSummary() {
    return this._activeSummary;
  }

  /**
   * Set the active item's summary element.
   *
   * @param DOMElement summary
   */
  set activeSummary(summary) {
  setActiveSummary(summary) {
    if (summary == this._activeSummary) {
      return;
    }
@@ -178,7 +169,7 @@ class SplitView {
    }
    summary.addEventListener("click", event => {
      event.stopPropagation();
      this.activeSummary = summary;
      this.setActiveSummary(summary);
    });

    this._nav.appendChild(summary);
@@ -201,7 +192,7 @@ class SplitView {
   */
  removeItem(summary) {
    if (summary == this._activeSummary) {
      this.activeSummary = null;
      this.setActiveSummary(null);
    }

    const binding = bindings.get(summary);
+2 −2
Original line number Diff line number Diff line
@@ -627,7 +627,7 @@ StyleEditorUI.prototype = {
      events: {
        keypress: event => {
          if (event.keyCode == KeyCodes.DOM_VK_RETURN) {
            this._view.activeSummary = summary;
            this._view.setActiveSummary(summary);
          }
        },
      },
@@ -780,7 +780,7 @@ StyleEditorUI.prototype = {
      if (!this.editors.includes(editor)) {
        throw new Error("Editor was destroyed");
      }
      this._view.activeSummary = summary;
      this._view.setActiveSummary(summary);
    });

    return Promise.all([editorPromise, summaryPromise]);
+1 −1
Original line number Diff line number Diff line
@@ -63,7 +63,7 @@ add_task(async function() {
  // Can't use ui.selectStyleSheet here as it will scroll the editor back to top
  // and we want to check that the previous scroll position is restored.
  const summary = await ui.getEditorSummary(longEditor);
  ui._view.activeSummary = summary;
  ui._view.setActiveSummary(summary);

  info("Waiting for doc_long.css to be selected.");
  await selectEventPromise;