mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-14 01:33:03 +00:00
Add fullscreen toggle key (#1327)
This commit is contained in:
@@ -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');
|
||||
};
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user