Files
iD/js/id/modes/browse.js
Bryan Housel 9311ee64ab Post save delay before fetching new data to allow for postgres replication
re: #2678 #2667 #1646
I cheated a bit by putting half the delay before showing success pane and half after.
2015-06-09 22:38:55 -04:00

52 lines
1.2 KiB
JavaScript

iD.modes.Browse = function(context) {
var mode = {
button: 'browse',
id: 'browse',
title: t('modes.browse.title'),
description: t('modes.browse.description')
}, sidebar;
var behaviors = [
iD.behavior.Paste(context),
iD.behavior.Hover(context)
.on('hover', context.ui().sidebar.hover),
iD.behavior.Select(context),
iD.behavior.Lasso(context),
iD.modes.DragNode(context).behavior];
mode.enter = function() {
behaviors.forEach(function(behavior) {
context.install(behavior);
});
// Get focus on the body.
if (document.activeElement && document.activeElement.blur) {
document.activeElement.blur();
}
if (sidebar) {
context.ui().sidebar.show(sidebar);
} else {
context.ui().sidebar.select(null);
}
};
mode.exit = function() {
behaviors.forEach(function(behavior) {
context.uninstall(behavior);
});
if (sidebar) {
context.ui().sidebar.hide();
}
};
mode.sidebar = function(_) {
if (!arguments.length) return sidebar;
sidebar = _;
return mode;
};
return mode;
};