Don't show "Editing" on hover

This commit is contained in:
John Firebaugh
2013-05-26 21:38:29 -07:00
parent 67a194f35f
commit c5e275cea5
3 changed files with 20 additions and 1 deletions
+10 -1
View File
@@ -1,5 +1,6 @@
iD.ui.EntityEditor = function(context) {
var event = d3.dispatch('choose'),
state = 'select',
id,
preset;
@@ -31,7 +32,9 @@ iD.ui.EntityEditor = function(context) {
// Update
$header.select('h3')
.text(t('inspector.editing_feature', {feature: preset.name()}));
.text(state === 'select' ?
t('inspector.editing_feature', {feature: preset.name()}) :
preset.name());
$header.select('.preset-reset')
.on('click', function() {
@@ -142,6 +145,12 @@ iD.ui.EntityEditor = function(context) {
}
}
entityEditor.state = function(_) {
if (!arguments.length) return state;
state = _;
return entityEditor;
};
entityEditor.entityID = function(_) {
if (!arguments.length) return id;
id = _;
+8
View File
@@ -1,6 +1,7 @@
iD.ui.Inspector = function(context) {
var presetList = iD.ui.PresetList(context),
entityEditor = iD.ui.EntityEditor(context),
state = 'select',
entityID,
newFeature = false;
@@ -27,6 +28,7 @@ iD.ui.Inspector = function(context) {
var $editorPane = $wrap.select('.entity-editor-pane')
.call(entityEditor
.state(state)
.entityID(entityID)
.on('choose', showList));
@@ -56,6 +58,12 @@ iD.ui.Inspector = function(context) {
selection.style('display', 'none');
};
inspector.state = function(_) {
if (!arguments.length) return state;
state = _;
return inspector;
};
inspector.entityID = function(_) {
if (!arguments.length) return entityID;
entityID = _;
+2
View File
@@ -10,6 +10,7 @@ iD.ui.Sidebar = function(context) {
wrap.classed('inspector-hidden', false)
.classed('inspector-hover', true)
.call(iD.ui.Inspector(context)
.state('hover')
.entityID(entity.id));
} else {
wrap.classed('inspector-hidden', true);
@@ -21,6 +22,7 @@ iD.ui.Sidebar = function(context) {
wrap.classed('inspector-hidden', false)
.classed('inspector-hover', false)
.call(iD.ui.Inspector(context)
.state('select')
.entityID(selection[0]));
} else {
wrap.classed('inspector-hidden', true);