Work around blur issue for #439

This commit is contained in:
Tom MacWright
2013-01-22 11:19:09 -05:00
parent d214c651f2
commit 55346c4d33
3 changed files with 19 additions and 4 deletions
+7
View File
@@ -293,6 +293,13 @@ webkit doesn't let querySelectorAll select camelcase elements:
* https://bugs.webkit.org/show_bug.cgi?id=83438
* https://github.com/mbostock/d3/issues/925
Firefox does not fire a `blur` event when an element is removed from the DOM,
unlike WebKit browsers.
Firefox does not support [the focusout event](https://bugzilla.mozilla.org/show_bug.cgi?id=687787).
Opera does not support `pointer-events` on HTML elements, only SVG elements.
## Transients
The graph supports `transient`, which is storage for non-versioned mutable
+5
View File
@@ -150,10 +150,15 @@ iD.modes.Select = function(entity) {
if (entity) {
changeTags(entity, inspector.tags());
}
d3.select('.inspector-wrap')
.style('display', 'none')
.html('');
// Firefox incorrectly implements blur, so typeahead elements
// are not correctly removed. Remove any stragglers manually.
d3.selectAll('div.typeahead').remove();
behaviors.forEach(function(behavior) {
behavior.off(surface);
});
+7 -4
View File
@@ -149,9 +149,12 @@ iD.ui.inspector = function() {
});
if (d.key && d.value) {
taginfo.docs(params, function(err, docs) {
var en = _.find(docs, function(d) {
return d.lang == 'en';
});
var en;
if (!err && docs) {
en = _.find(docs, function(d) {
return d.lang == 'en';
});
}
if (en) {
var types = [];
if (en.on_area) types.push('area');
@@ -170,7 +173,7 @@ iD.ui.inspector = function() {
});
} else if (d.key) {
taginfo.values(params, function(err, values) {
if (values.data.length) {
if (!err && values.data.length) {
iD.ui.modal()
.select('.content')
.datum({