mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-14 09:42:56 +00:00
Move controller to own file
This commit is contained in:
@@ -47,6 +47,8 @@
|
||||
<script type='text/javascript' src='js/iD/actions/actions.js'></script>
|
||||
<script type='text/javascript' src='js/iD/actions/operations.js'></script>
|
||||
|
||||
<script type='text/javascript' src='js/iD/controller/controller.js'></script>
|
||||
|
||||
<script type='text/javascript' src='js/iD/format/format.js'></script>
|
||||
<script type='text/javascript' src='js/iD/format/GeoJSON.js'></script>
|
||||
<script type='text/javascript' src='js/iD/format/XML.js'></script>
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user