Add fullscreen toggle key (#1327)

This commit is contained in:
John Firebaugh
2013-04-19 14:53:00 -07:00
parent 4cfd5eae9f
commit 0e46ff397b
2 changed files with 7 additions and 2 deletions

View File

@@ -18,7 +18,7 @@ window.iD = function () {
};
var history = iD.History(context),
dispatch = d3.dispatch('enter', 'exit'),
dispatch = d3.dispatch('enter', 'exit', 'toggleFullscreen'),
mode,
container,
ui = iD.ui(context),
@@ -172,6 +172,10 @@ window.iD = function () {
return context;
};
context.toggleFullscreen = function() {
dispatch.toggleFullscreen();
};
return d3.rebind(context, dispatch, 'on');
};

View File

@@ -136,7 +136,8 @@ iD.ui = function(context) {
.on('←', pan([pa, 0]))
.on('↑', pan([0, pa]))
.on('→', pan([-pa, 0]))
.on('↓', pan([0, -pa]));
.on('↓', pan([0, -pa]))
.on('M', function() { context.toggleFullscreen(); });
d3.select(document)
.call(keybinding);