Fix photoviewer resize event

This commit is contained in:
Bryan Housel
2018-11-06 13:09:04 -05:00
parent b4119ae1ad
commit 08e9476f3e
4 changed files with 8 additions and 8 deletions

View File

@@ -372,7 +372,7 @@ export default {
defs.call(svgDefs(context).addSprites, ['mapillary-sprite']);
// Register viewer resize handler
context.ui().on('photoviewerResize', function() {
context.ui().photoviewer.on('resize', function() {
if (_mlyViewer) {
_mlyViewer.resize();
}

View File

@@ -327,7 +327,7 @@ export default {
// Register viewer resize handler
context.ui().on('photoviewerResize', function(dimensions) {
context.ui().photoviewer.on('resize', function(dimensions) {
imgZoom = d3_zoom()
.extent([[0, 0], dimensions])
.translateExtent([[0, 0], dimensions])

View File

@@ -626,7 +626,7 @@ export default {
// Register viewer resize handler
context.ui().on('photoviewerResize', function() {
context.ui().photoviewer.on('resize', function() {
if (_pannellumViewer) {
_pannellumViewer.resize();
}

View File

@@ -11,7 +11,7 @@ import { services } from '../services';
export function uiPhotoviewer(context) {
var dispatch = d3_dispatch('photoviewerResize');
var dispatch = d3_dispatch('resize');
function photoviewer(selection) {
selection
@@ -30,7 +30,7 @@ export function uiPhotoviewer(context) {
.attr('class', 'resize-handle-xy')
.on(
'mousedown',
buildResizeListener(selection, 'photoviewerResize', dispatch, { resizeOnX: true, resizeOnY: true })
buildResizeListener(selection, 'resize', dispatch, { resizeOnX: true, resizeOnY: true })
);
selection
@@ -38,7 +38,7 @@ export function uiPhotoviewer(context) {
.attr('class', 'resize-handle-x')
.on(
'mousedown',
buildResizeListener(selection, 'photoviewerResize', dispatch, { resizeOnX: true })
buildResizeListener(selection, 'resize', dispatch, { resizeOnX: true })
);
selection
@@ -46,7 +46,7 @@ export function uiPhotoviewer(context) {
.attr('class', 'resize-handle-y')
.on(
'mousedown',
buildResizeListener(selection, 'photoviewerResize', dispatch, { resizeOnY: true })
buildResizeListener(selection, 'resize', dispatch, { resizeOnY: true })
);
@@ -117,7 +117,7 @@ export function uiPhotoviewer(context) {
.style('width', setPhotoDimensions[0] + 'px')
.style('height', setPhotoDimensions[1] + 'px');
dispatch.call('photoviewerResize', photoviewer, setPhotoDimensions);
dispatch.call('resize', photoviewer, setPhotoDimensions);
}
};