Files
iD/js/id/modes/browse.js
John Firebaugh 7e68e8e114 Add iD.Context
This is a facade interface that ties together a bunch of
different internal objects and will make it easier to write
tests for behaviors, modes, and operations.
2013-02-01 12:40:15 -05:00

30 lines
703 B
JavaScript

iD.modes.Browse = function(context) {
var mode = {
button: 'browse',
id: 'browse',
title: t('modes.browse.title'),
description: t('modes.browse.description'),
key: t('modes.browse.key')
};
var behaviors = [
iD.behavior.Hover(),
iD.behavior.Select(context),
iD.behavior.DragNode(context),
iD.behavior.DragMidpoint(context)];
mode.enter = function() {
behaviors.forEach(function(behavior) {
context.install(behavior);
});
};
mode.exit = function() {
behaviors.forEach(function(behavior) {
context.uninstall(behavior);
});
};
return mode;
};