Commit ef9454d5 by Masaru Abe

#12373 #12408 ページ遷移時の拡大率保持とホイールでの上下スクロール対応

parent 491dcbc8
/// <reference path="../common/js/jquery-ui-1.8.23.custom.min.js" />
/// <reference path="../common/js/common.js" />
/// <reference path="contentview_VarDef.js" />
/// <reference path="contentview_CallApi.js" />
/// <reference path="contentview_GetData.js" />
/// <reference path="contentview_InitObjects.js" />
/// <reference path="contentview_Events.js" />
/* change size */
function sizingScreen() {
var w, h;
......@@ -3683,9 +3675,24 @@ function setDefaultEvent() {
if(avwUserEnvObj.os != "ipad" && avwUserEnvObj.os != "android"){
document.getElementById('main').addEventListener('mousedown', mouseDown_CanvasMain, false);
document.getElementById('main').addEventListener('mousemove', mouseMove_canvasMain, false);
document.getElementById('main').addEventListener('mousemove', mouseMove_CanvasMain, false);
document.getElementById('main').addEventListener('mouseup', mouseUp_CanvasMain, false);
//#12408 ホイール対応
// MouseScrollEvent に対応している(FireFox 専用)
if(window.MouseScrollEvent){
console.log("addEventListener DOMMouseScroll");
document.getElementById('main').addEventListener('DOMMouseScroll', function(event){
mouseWheel_CanvasMain(event, event.detail);
}, false);
// FireFox 以外の主要ブラウザの場合
}else{
console.log("addEventListener mousewheel");
document.getElementById('main').addEventListener('mousewheel', function(e){
mouseWheel_CanvasMain(event, event.wheelDelta);
}, false);
}
if (avwUserEnvObj.browser == 'msie') {
_bWin8TouchEnabled = window.navigator.msPointerEnabled;
} else {
......
......@@ -1715,6 +1715,9 @@ var Transition = function () { };
/* Flip Next Page Transition */
Transition.prototype.flipNextPage = function () {
//#12373
var tmpScale = 1;
var w = $('#canvasWrapper').width();
removeObject();
if(animateType == animateTypeKeys.Type_FadeIn){
......@@ -1728,15 +1731,19 @@ Transition.prototype.flipNextPage = function () {
if (getContent().hasNextPage()) {
tmpScale = userScale;
userScale = 1;
flip(1);
if(animateType == animateTypeKeys.Type_Slide){
$('#canvasWrapper').stop(true).animate(
{ left: '-' + w + 'px' },
{
duration: animatePeriod,
complete: function () {
assignCurrentContentPage(1);
//Change id of canvas
switchCanvas(1);
......@@ -1749,7 +1756,6 @@ Transition.prototype.flipNextPage = function () {
//Change slider
changeSlider(getContent().pageIndex);
//Draw marking on current screen
//drawMarkingOnScreen();
......@@ -1791,6 +1797,16 @@ Transition.prototype.flipNextPage = function () {
SetEndLog(contentID);
createLockLayout(false);
initImageCheckMarking();
//#12373
//console.log("tmpScale:" + tmpScale);
if (tmpScale != 1) {
userScale = tmpScale;
changeScale(userScale);
flip();
checkDisableButtonZoom();
}
}
});
}
......@@ -1862,6 +1878,10 @@ Transition.prototype.flipNextPage = function () {
};
/* Flip Previous Page Transition */
Transition.prototype.flipPreviousPage = function () {
//#12373
var tmpScale = 1;
var w = $('#canvasWrapper').width();
removeObject();
if(animateType == animateTypeKeys.Type_FadeIn){
......@@ -1872,7 +1892,12 @@ Transition.prototype.flipPreviousPage = function () {
else{
$('#mainPre').css('display', 'block');
}
if (getContent().hasPreviousPage()) {
if (getContent().hasPreviousPage()) {
tmpScale = userScale;
userScale = 1;
flip(2);
if(animateType == animateTypeKeys.Type_Slide){
$('#canvasWrapper').stop(true).animate(
{ left: w + 'px' },
......@@ -1933,6 +1958,17 @@ Transition.prototype.flipPreviousPage = function () {
SetEndLog(contentID);
createLockLayout(false);
initImageCheckMarking();
//#12373
//console.log("tmpScale:" + tmpScale);
if (tmpScale != 1) {
userScale = tmpScale;
changeScale(userScale);
flip();
checkDisableButtonZoom();
}
}
});
}
......@@ -2004,6 +2040,9 @@ Transition.prototype.flipPreviousPage = function () {
/* Flip Page Transition */
Transition.prototype.flipToPage = function (index) {
//#12373
var tmpScale = userScale;
var w = $('#main').attr('width');
if (index == getContent().pageIndex) {
......@@ -2076,6 +2115,15 @@ Transition.prototype.flipToPage = function (index) {
initImageCheckMarking();
createLockLayout(false);
//#12373
//console.log("tmpScale:" + tmpScale);
if (tmpScale != 1) {
userScale = tmpScale;
changeScale(userScale);
flip();
}
}
}
);
......@@ -2146,6 +2194,15 @@ Transition.prototype.flipToPage = function (index) {
initImageCheckMarking();
createLockLayout(false);
//#12373
//console.log("tmpScale:" + tmpScale);
if (tmpScale != 1) {
userScale = tmpScale;
changeScale(userScale);
flip();
}
}
});
}
......
......@@ -953,7 +953,46 @@ function onClick_CanvasMain(event) {
cancelClick = false;
};
function mouseMove_canvasMain(event) {
//#12408 ホイール対応
function mouseWheel_CanvasMain(event, detail) {
//console.log("mouseWheel:" + detail);
event.preventDefault();
if(_isTouching){
return;
}
if(ClientData.IsAddingMarking() == true){
return;
}
if(isLoadingObject){
moveFlag = false;
}
/* base image move when userScale over 1 */
if ( userScale != 1) {
//$('#main').css('cursor', 'pointer');
//var sx = 1 / userScale;
var sy = 1 / userScale;
// calc scaling moving distance
//moveX = Math.round(detail * sx);
moveY = Math.round(detail * sy * 20); //20は感覚的な移動量の補正
// redraw
flip();
zoomVideo();
closeDialogPopUpText();
}
};
function mouseMove_CanvasMain(event) {
event.preventDefault();
......
......@@ -1472,9 +1472,11 @@ function switchCanvas(nav){
destRectPrev = destRect;
destRect = destRectNext;
//#12373
userScale = 1;
changeScale(userScale);
flip();
//#12373
//END TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content
}
else{
......@@ -1508,9 +1510,10 @@ function switchCanvas(nav){
destRectNext = destRect;
destRect = destRectPrev;
//#12373
userScale = 1;
//#12373
changeScale(userScale);
flip();
//END TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment