提交 1a0c58f1 编写于 作者: J Joao Moreno

list: remove wrapper dom node

上级 cf727801
......@@ -13,26 +13,20 @@
-ms-user-select: none;
-o-user-select: none;
user-select: none;
position: relative;
}
.monaco-list > .monaco-scrollable-element {
height: 100%;
}
.monaco-list > .monaco-scrollable-element > .monaco-list-wrapper {
height: 100%;
width: 100%;
position: relative;
}
.monaco-list .monaco-list-rows {
.monaco-list-rows {
position: relative;
width: 100%;
height: 100%;
}
.monaco-list .monaco-list-rows > .monaco-list-row {
.monaco-list-row {
position: absolute;
-moz-box-sizing: border-box;
-o-box-sizing: border-box;
-ms-box-sizing: border-box;
......@@ -41,31 +35,9 @@
overflow: hidden;
width: 100%;
touch-action: none;
position: absolute;
}
.monaco-list .monaco-list-rows > .monaco-list-row > .content {
position: relative;
-moz-transition: opacity 0.15s ease-out;
-webkit-transition: opacity 0.15s ease-out;
-ms-transition: opacity 0.15s ease-out;
-o-transition: opacity 0.15s ease-out;
transition: opacity 0.15s ease-out;
}
.monaco-list-drag-image {
display: inline-block;
padding: 1px 7px;
color: white;
background-color: #4A4A4A;
border-radius: 10px;
font-size: 12px;
position: absolute;
top: 0;
left: 0;
}
/* for OS X ballistic scrolling */
.monaco-list .monaco-list-rows > .monaco-list-row.scrolling {
.monaco-list-row.scrolling {
display: none;
}
\ No newline at end of file
......@@ -54,7 +54,6 @@ export class ListView<T> implements IScrollable {
private renderHeight: number;
private domNode: HTMLElement;
private wrapper: HTMLElement;
private gesture: Gesture;
private rowsContainer: HTMLElement;
private onScroll: Emitter<IScrollEvent>;
......@@ -78,24 +77,20 @@ export class ListView<T> implements IScrollable {
this.domNode.className = 'monaco-list';
this.domNode.tabIndex = 0;
this.wrapper = document.createElement('div');
this.wrapper.className = 'monaco-list-wrapper';
this.rowsContainer = document.createElement('div');
this.rowsContainer.className = 'monaco-list-rows';
this.gesture = new Gesture(this.rowsContainer);
this.onScroll = new Emitter<IScrollEvent>();
this.scrollableElement = new ScrollableElement(this.wrapper, {
this.scrollableElement = new ScrollableElement(this.rowsContainer, {
forbidTranslate3dUse: true,
scrollable: this,
horizontal: 'hidden',
vertical: 'auto',
useShadows: true,
useShadows: false,
saveLastScrollTimeOnClassName: 'monaco-list-row'
});
this.gesture = new Gesture(this.wrapper);
this.rowsContainer = document.createElement('div');
this.rowsContainer.className = 'monaco-list-rows';
this.wrapper.appendChild(this.rowsContainer);
this.domNode.appendChild(this.scrollableElement.getDomNode());
container.appendChild(this.domNode);
......@@ -141,7 +136,7 @@ export class ListView<T> implements IScrollable {
}
layout(height?: number): void {
this.setRenderHeight(height || DOM.getContentHeight(this.wrapper));
this.setRenderHeight(height || DOM.getContentHeight(this.domNode));
this.setScrollTop(this.renderTop);
this.scrollableElement.onElementDimensions();
this.scrollableElement.onElementInternalDimensions();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册