mirror of
https://github.com/FoggedLens/iD.git
synced 2026-03-07 11:51:35 +00:00
stop leaving combobox divs lying around
This commit is contained in:
@@ -15,15 +15,6 @@ d3.combobox = function() {
|
||||
var idx = -1;
|
||||
input = selection.select('input');
|
||||
|
||||
container = d3.select(document.body)
|
||||
.insert('div', ':first-child')
|
||||
.attr('class', 'combobox')
|
||||
.style({
|
||||
position: 'absolute',
|
||||
display: 'none',
|
||||
left: '0px'
|
||||
});
|
||||
|
||||
selection.append('a', selection.select('input'))
|
||||
.attr('class', 'combobox-carat')
|
||||
.on('mousedown', stop)
|
||||
@@ -64,14 +55,26 @@ d3.combobox = function() {
|
||||
}
|
||||
|
||||
function show() {
|
||||
container.style('display', 'block');
|
||||
shown = true;
|
||||
if (!shown) {
|
||||
container = d3.select(document.body)
|
||||
.insert('div', ':first-child')
|
||||
.attr('class', 'combobox')
|
||||
.style({
|
||||
position: 'absolute',
|
||||
display: 'block',
|
||||
left: '0px'
|
||||
});
|
||||
|
||||
shown = true;
|
||||
}
|
||||
}
|
||||
|
||||
function hide() {
|
||||
idx = -1;
|
||||
container.style('display', 'none');
|
||||
shown = false;
|
||||
if (shown) {
|
||||
idx = -1;
|
||||
container.remove();
|
||||
shown = false;
|
||||
}
|
||||
}
|
||||
|
||||
function slowHide() {
|
||||
|
||||
Reference in New Issue
Block a user