Commit fba1b7a55cb3a4e67797c16851ba9ff01430f77f
1 parent
043ea602
commit navman
Showing
2 changed files
with
10 additions
and
50 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... | ... | @@ -471,8 +471,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
471 | 471 | $http({ method: 'GET', url: '~/../content/data/json/da/da_dat_orient_image.json' }).success(function (data) { |
472 | 472 | $scope.NavigatorData = data; |
473 | 473 | |
474 | - // $scope.NavOrientationdata = $scope.NavigatorData.Navigtor.ViewOrientation; | |
475 | - | |
476 | 474 | $scope.skinTone = DA[0].ethnicity; |
477 | 475 | |
478 | 476 | $scope.viewOrientationId = $scope.voId; |
... | ... | @@ -496,7 +494,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
496 | 494 | var navimagemodesty; |
497 | 495 | |
498 | 496 | angular.forEach($scope.NavOrientationdata, function (value, key) { |
499 | - //debugger; | |
500 | 497 | if (value._HaveModesty === DA[0].modesty) { |
501 | 498 | navimagemodesty = value._ImageName; |
502 | 499 | } |
... | ... | @@ -507,40 +504,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
507 | 504 | |
508 | 505 | } |
509 | 506 | |
510 | - alert(navimagemodesty); | |
511 | - | |
512 | - // var imageObj = new Image(); | |
513 | - | |
514 | 507 | $scope.navimgsrc = "~/../content/images/DA/ethnicity/body-views/" + $scope.viewOrientationId + '/' + $scope.skinTone + '/navigator_images/' + navimagemodesty; |
515 | 508 | |
516 | - var x = $("#draggable").position(); | |
517 | - alert("Drag Top position: " + x.top + "Drag Left position: " + x.left); | |
518 | - | |
519 | - | |
520 | - | |
521 | - | |
522 | - | |
523 | - //$('#daBodyview').css("height", $(window).outerHeight()); | |
524 | - | |
525 | - //$('#daBodyview').css("width", $(window).outerWidth()); | |
526 | - | |
527 | - //alert("canvasDiv height:" + $('#draggable').height() + "/n canvasDiv Width:" + $('#canvasDiv').width()); | |
528 | - | |
529 | - //imageObj.src = navimgsrc; | |
530 | - | |
531 | - //var canvas = document.getElementById('navcanvas'); | |
532 | - //var context = canvas.getContext('2d'); | |
533 | - //var imageObj = new Image(); | |
534 | - | |
535 | - //imageObj.onload = function () { | |
536 | - // context.drawImage(imageObj, 0, 0); | |
537 | - //}; | |
538 | - | |
539 | - //imageObj.src = navimgsrc; | |
540 | - | |
541 | - | |
542 | - | |
543 | - | |
544 | 509 | |
545 | 510 | }) |
546 | 511 | .error(function (data, status, headers, config) { |
... | ... | @@ -868,6 +833,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
868 | 833 | |
869 | 834 | //$('#containment-wrapper').css('width', navdivw); |
870 | 835 | //$('#containment-wrapper').css('height', navdivh) |
836 | + //$scope.ycan = $("#canvasDiv").scrollTop(); | |
837 | + //$scope.xcan = $("#canvasDiv").scrollLeft(); | |
871 | 838 | } |
872 | 839 | |
873 | 840 | function scaleRectangle(x, y, height, width, mirrorValue) { |
... | ... | @@ -4175,23 +4142,16 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4175 | 4142 | $scope.ScrollCanvasDiv = function () { |
4176 | 4143 | |
4177 | 4144 | var x = $("#draggable").position(); |
4178 | - alert("Top position: " + x.top + " Left position: " + x.left); | |
4179 | - | |
4180 | - | |
4181 | - | |
4182 | - | |
4183 | - alert("CanvasDiv x scroll:" + $("#canvasDiv").scrollLeft() + "\n CanvasDiv y scroll:" + $("#canvasDiv").scrollTop()); | |
4184 | - | |
4185 | - var scrolly = ((((x.top) * 4) * 3) + 10) * 2; | |
4186 | - | |
4187 | - //var scrollx = ((((x.left) * 2) * 9) - 10) * 2; | |
4188 | - | |
4189 | - alert("calculation y:"+scrolly); | |
4145 | + var can = $('#canvasDiv'); | |
4146 | + var canheight = can[0].scrollHeight; | |
4147 | + var canwidth = can[0].scrollWidth; | |
4190 | 4148 | |
4191 | - $("#canvasDiv").scrollTop(scrolly); | |
4192 | - // $("#canvasDiv").scrollLeft(scrollx); | |
4149 | + var scrolly = (x.top/($('#containment-wrapper').height())) * (canheight) ; | |
4193 | 4150 | |
4151 | + var scrollx = (x.left/$('#containment-wrapper').width()) * (canwidth); | |
4194 | 4152 | |
4153 | + $("#canvasDiv").scrollTop(scrolly); | |
4154 | + $("#canvasDiv").scrollLeft(scrollx); | |
4195 | 4155 | |
4196 | 4156 | } |
4197 | 4157 | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html
... | ... | @@ -203,7 +203,7 @@ |
203 | 203 | <div class="paddlftrgt10" id="containment-wrapper" align="center" style="width:120px;height:144px;"> |
204 | 204 | <!--<img src="~/../content/images/DA/ethnicity/body-views/1/A/navigator_images/da_oi_81.jpg" alt="">--> |
205 | 205 | <img src="{{navimgsrc}}" alt=""></img> |
206 | - <div id="draggable" class="draggable ui-widget-content" ng-click="ScrollCanvasDiv()" ng-style="dragdivposition"> | |
206 | + <div id="draggable" class="draggable ui-widget-content" ng-mouseup="ScrollCanvasDiv()" ng-style="dragdivposition"> | |
207 | 207 | </div> |
208 | 208 | </div> |
209 | 209 | </div> | ... | ... |