summaryrefslogtreecommitdiff
path: root/deps/v8/tools/turbolizer/view.js
blob: a7c1f1e4178da1eefb9b456b395078c96b750956 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright 2015 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

"use strict";

class View {
  constructor(id, broker) {
    this.divElement = d3.select("#" + id);
    this.divNode = this.divElement[0][0];
    this.parentNode = this.divNode.parentNode;
  }

  isScrollable() {
    return false;
  }

  show(data, rememberedSelection) {
    this.parentNode.appendChild(this.divElement[0][0]);
    this.initializeContent(data, rememberedSelection);
    this.divElement.attr(VISIBILITY, 'visible');
  }

  hide() {
    this.divElement.attr(VISIBILITY, 'hidden');
    this.deleteContent();
    this.parentNode.removeChild(this.divNode);
  }

  detachSelection() {
    return null;
  }
}