mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.1 KiB
45 lines
1.1 KiB
// 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.resizeToParent();
|
|
this.divElement.attr(VISIBILITY, 'visible');
|
|
}
|
|
|
|
resizeToParent() {
|
|
var view = this;
|
|
var documentElement = document.documentElement;
|
|
var y;
|
|
if (this.parentNode.clientHeight)
|
|
y = Math.max(this.parentNode.clientHeight, documentElement.clientHeight);
|
|
else
|
|
y = documentElement.clientHeight;
|
|
this.parentNode.style.height = y + 'px';
|
|
}
|
|
|
|
hide() {
|
|
this.divElement.attr(VISIBILITY, 'hidden');
|
|
this.deleteContent();
|
|
this.parentNode.removeChild(this.divNode);
|
|
}
|
|
|
|
detachSelection() {
|
|
return null;
|
|
}
|
|
}
|
|
|