From 68ee31ea29fa3f3e6ca7cf16031b2900787232f9 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Thu, 8 Nov 2012 15:45:39 -0800 Subject: [PATCH] Move controller to own file --- index.html | 2 ++ js/iD/actions/actions.js | 20 -------------------- js/iD/controller/controller.js | 20 +++++++++++++++++++- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/index.html b/index.html index 08e755cf2..2b5301b05 100755 --- a/index.html +++ b/index.html @@ -47,6 +47,8 @@ + + diff --git a/js/iD/actions/actions.js b/js/iD/actions/actions.js index 8cd2f09ef..1757efc1e 100644 --- a/js/iD/actions/actions.js +++ b/js/iD/actions/actions.js @@ -177,23 +177,3 @@ iD.actions.Move = { }, exit: function() { } }; - -// A controller holds a single action at a time and calls `.enter` and `.exit` -// to bind and unbind actions. -iD.controller = function(map) { - var controller = { action: null }; - - controller.go = function(x) { - x.controller = controller; - x.map = map; - if (controller.action) { - controller.action.exit(); - } - x.enter(); - controller.action = x; - }; - - controller.go(iD.actions.Move); - - return controller; -}; diff --git a/js/iD/controller/controller.js b/js/iD/controller/controller.js index 4375209c7..855f6e416 100644 --- a/js/iD/controller/controller.js +++ b/js/iD/controller/controller.js @@ -1 +1,19 @@ -iD.controller = {}; +// A controller holds a single action at a time and calls `.enter` and `.exit` +// to bind and unbind actions. +iD.controller = function(map) { + var controller = { action: null }; + + controller.go = function(x) { + x.controller = controller; + x.map = map; + if (controller.action) { + controller.action.exit(); + } + x.enter(); + controller.action = x; + }; + + controller.go(iD.actions.Move); + + return controller; +};