Refactor away multi requirement

This commit is contained in:
Tom MacWright
2016-09-03 15:13:20 -04:00
parent 8029d4de62
commit b493c85399
4 changed files with 17 additions and 21 deletions
-1
View File
@@ -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
View File
@@ -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) {
+5 -7
View File
@@ -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)
+5 -3
View File
@@ -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;
}