From 6188d128f8d12e73a874b71c46ad8f0c6c078ca6 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Fri, 1 Feb 2013 11:50:07 -0500 Subject: [PATCH] Arrange --- js/id/id.js | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/js/id/id.js b/js/id/id.js index b2d28fb3f..ce8131bc9 100644 --- a/js/id/id.js +++ b/js/id/id.js @@ -14,7 +14,7 @@ window.iD = function () { context.history = function () { return history; }; context.map = function () { return map; }; - /* History delegation. */ + /* History */ context.graph = history.graph; context.perform = history.perform; context.replace = history.replace; @@ -23,9 +23,16 @@ window.iD = function () { context.redo = history.undo; context.changes = history.changes; - context.entity = function (id) { return history.graph().entity(id); }; - context.geometry = function (id) { return context.entity(id).geometry(history.graph()); }; + /* Graph */ + context.entity = function (id) { + return history.graph().entity(id); + }; + context.geometry = function (id) { + return context.entity(id).geometry(history.graph()); + }; + + /* Modes */ context.enter = function(newMode) { if (mode) { mode.exit(); @@ -41,9 +48,16 @@ window.iD = function () { return mode; }; - context.install = function (behavior) { context.surface().call(behavior); }; - context.uninstall = function (behavior) { context.surface().call(behavior.off); }; + /* Behaviors */ + context.install = function (behavior) { + context.surface().call(behavior); + }; + context.uninstall = function (behavior) { + context.surface().call(behavior.off); + }; + + /* Map */ context.background = function () { return map.background; }; context.surface = function () { return map.surface; }; context.projection = map.projection;