Keep move cursor while adjusting imagery offset

(closes #3101)
This commit is contained in:
Bryan Housel
2016-05-07 00:19:06 -04:00
parent 263363448e
commit d17f22eb7d
2 changed files with 18 additions and 0 deletions

View File

@@ -2042,6 +2042,17 @@ div.full-screen > button:hover {
right: -10px;
}
.nudge-surface {
position: absolute;
z-index: 5000;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: transparent;
cursor: move;
}
.background-control .nudge.right::after {
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;

View File

@@ -204,6 +204,10 @@ iD.ui.Background = function(context) {
function dragOffset() {
var origin = [d3.event.clientX, d3.event.clientY];
context.container()
.append('div')
.attr('class', 'nudge-surface');
d3.select(window)
.on('mousemove.offset', function() {
var latest = [d3.event.clientX, d3.event.clientY];
@@ -216,6 +220,9 @@ iD.ui.Background = function(context) {
nudge(d);
})
.on('mouseup.offset', function() {
d3.selectAll('.nudge-surface')
.remove();
d3.select(window)
.on('mousemove.offset', null)
.on('mouseup.offset', null);