mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 21:48:20 +02:00
Refactor away multi requirement
This commit is contained in:
@@ -13,7 +13,6 @@
|
||||
<meta name='apple-mobile-web-app-status-bar-style' content='black-translucent' />
|
||||
|
||||
<script src='dist/iD.js'></script>
|
||||
<script src='../node_modules/d3-selection/build/d3-selection.js'></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id='id-container'></div>
|
||||
|
||||
+7
-10
@@ -72,11 +72,9 @@ export function d3combobox() {
|
||||
.insert('div', ':first-child')
|
||||
.datum(input.node())
|
||||
.attr('class', 'combobox')
|
||||
.styles({
|
||||
position: 'absolute',
|
||||
display: 'block',
|
||||
left: '0px'
|
||||
})
|
||||
.style('position', 'absolute')
|
||||
.style('display', 'block')
|
||||
.style('left', '0px')
|
||||
.on('mousedown', function () {
|
||||
// prevent moving focus out of the text field
|
||||
d3.event.preventDefault();
|
||||
@@ -233,11 +231,10 @@ export function d3combobox() {
|
||||
var node = attachTo ? attachTo.node() : input.node(),
|
||||
rect = node.getBoundingClientRect();
|
||||
|
||||
container.styles({
|
||||
'left': rect.left + 'px',
|
||||
'width': rect.width + 'px',
|
||||
'top': rect.height + rect.top + 'px'
|
||||
});
|
||||
container
|
||||
.style('left', rect.left + 'px')
|
||||
.style('width', rect.width + 'px')
|
||||
.style('top', rect.height + rect.top + 'px');
|
||||
}
|
||||
|
||||
function select(d, i) {
|
||||
|
||||
@@ -15,13 +15,11 @@ export function d3curtain() {
|
||||
function curtain(selection) {
|
||||
surface = selection.append('svg')
|
||||
.attr('id', 'curtain')
|
||||
.styles({
|
||||
'z-index': 1000,
|
||||
'pointer-events': 'none',
|
||||
'position': 'absolute',
|
||||
'top': 0,
|
||||
'left': 0
|
||||
});
|
||||
.style('z-index', 1000)
|
||||
.style('pointer-events', 'none')
|
||||
.style('position', 'absolute')
|
||||
.style('top', 0)
|
||||
.style('left', 0);
|
||||
|
||||
darkness = surface.append('path')
|
||||
.attr('x', 0)
|
||||
|
||||
@@ -123,9 +123,11 @@ export function tooltip() {
|
||||
break;
|
||||
}
|
||||
|
||||
tip.styles(pos ?
|
||||
{left: ~~pos.x + 'px', top: ~~pos.y + 'px'} :
|
||||
{left: null, top: null});
|
||||
if (pos) {
|
||||
tip.style('left', ~~pos.x + 'px').style('top', ~~pos.y + 'px');
|
||||
} else {
|
||||
tip.style('left', null).style('top', null);
|
||||
}
|
||||
|
||||
this.tooltipVisible = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user