Commit df1d568f834c3651a19137d6e2c7598f96054290
1 parent
c93e853a
Inactive highlight in next click.
Showing
1 changed file
with
59 additions
and
30 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... | ... | @@ -1319,28 +1319,59 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1319 | 1319 | |
1320 | 1320 | } |
1321 | 1321 | |
1322 | - $scope.highLightBodyBasedOnIcolor = function (RGBColor) | |
1323 | - { | |
1322 | + $scope.highLightBodyBasedOnIcolor = function (RGBColor) { | |
1323 | + | |
1324 | + if ($scope.previousSelectedTermList.length > 0) { | |
1325 | + | |
1326 | + //alert('previousSelectedTermList length: ' + $scope.previousSelectedTermList.length); | |
1327 | + | |
1328 | + for (var i = 0; i < $scope.previousSelectedTermList.length; i++) { | |
1329 | + var RGBColor = $scope.previousSelectedTermList[i]; | |
1330 | + | |
1331 | + | |
1332 | + | |
1333 | + //2. Find Actul Term No Based on Icolor. | |
1334 | + var ActualTermNo = $scope.getActualTermNumber(RGBColor); | |
1335 | + | |
1336 | + //3. Find Term No List Based on ActualTermNo | |
1337 | + var TermList = $scope.getTermNumberList(ActualTermNo); | |
1324 | 1338 | |
1325 | - //2. Find Actul Term No Based on Icolor. | |
1326 | - var ActualTermNo = $scope.getActualTermNumber(RGBColor); | |
1327 | - | |
1328 | - //3. Find Term No List Based on ActualTermNo | |
1329 | - var TermList = $scope.getTermNumberList(ActualTermNo); | |
1330 | - | |
1331 | 1339 | |
1332 | - //4. | |
1340 | + //4. | |
1333 | 1341 | |
1334 | - $scope.machedTermNoLocation = []; | |
1335 | - for (var i = 0; i < TermList.length; i++) { | |
1342 | + $scope.machedTermNoLocation = []; | |
1343 | + for (var i = 0; i < TermList.length; i++) { | |
1336 | 1344 | |
1337 | - var termNumber = parseInt(TermList[i]._TermNumber); | |
1345 | + var termNumber = parseInt(TermList[i]._TermNumber); | |
1338 | 1346 | |
1339 | - //Match Term No List in each bodyRegion | |
1340 | - $scope.getLocationsForMatchedTermsInWholeBody(termNumber); | |
1347 | + //Match Term No List in each bodyRegion | |
1348 | + $scope.getLocationsForMatchedTermsInWholeBody(termNumber); | |
1349 | + } | |
1350 | + } | |
1351 | + } | |
1352 | + else { | |
1353 | + //2. Find Actul Term No Based on Icolor. | |
1354 | + var ActualTermNo = $scope.getActualTermNumber(RGBColor); | |
1355 | + | |
1356 | + //3. Find Term No List Based on ActualTermNo | |
1357 | + var TermList = $scope.getTermNumberList(ActualTermNo); | |
1358 | + | |
1359 | + | |
1360 | + //4. | |
1361 | + | |
1362 | + $scope.machedTermNoLocation = []; | |
1363 | + for (var i = 0; i < TermList.length; i++) { | |
1364 | + | |
1365 | + var termNumber = parseInt(TermList[i]._TermNumber); | |
1366 | + | |
1367 | + //Match Term No List in each bodyRegion | |
1368 | + $scope.getLocationsForMatchedTermsInWholeBody(termNumber); | |
1369 | + } | |
1341 | 1370 | } |
1342 | 1371 | } |
1343 | 1372 | |
1373 | + | |
1374 | + | |
1344 | 1375 | $scope.getLocationsForMatchedTermsInWholeBody = function (termNo) |
1345 | 1376 | { |
1346 | 1377 | |
... | ... | @@ -1502,7 +1533,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1502 | 1533 | |
1503 | 1534 | } |
1504 | 1535 | |
1505 | - | |
1536 | + // grayCanvasContext.putImageData(grayImageData, 0, 0); | |
1506 | 1537 | } |
1507 | 1538 | |
1508 | 1539 | grayCanvasContext.putImageData(grayImageData, 0, 0); |
... | ... | @@ -3193,11 +3224,18 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
3193 | 3224 | } |
3194 | 3225 | |
3195 | 3226 | $scope.enableHighlight = function () { |
3196 | - $rootScope.isHighLight = true; | |
3197 | 3227 | |
3198 | - // alert('enableHighlight is called'); | |
3228 | + if ($rootScope.isHighLight == true) | |
3229 | + { | |
3230 | + | |
3231 | + } | |
3232 | + else | |
3233 | + { | |
3234 | + $rootScope.isHighLight = true; | |
3235 | + $scope.highLightBody(); | |
3236 | + } | |
3199 | 3237 | |
3200 | - $scope.highLightBody(); | |
3238 | + | |
3201 | 3239 | } |
3202 | 3240 | |
3203 | 3241 | |
... | ... | @@ -3291,23 +3329,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
3291 | 3329 | } |
3292 | 3330 | } |
3293 | 3331 | |
3294 | - $timeout(function () { imageCanvas.style.visibility = 'visible' }, 250); | |
3332 | + $timeout(function () { imageCanvas.style.visibility = 'visible' }, 50); | |
3295 | 3333 | |
3296 | 3334 | |
3297 | 3335 | |
3298 | 3336 | }); |
3299 | 3337 | |
3300 | - //alert('length: ' + $scope.previousSelectedTermList.length); | |
3301 | - | |
3302 | - if ($scope.previousSelectedTermList.length > 0) { | |
3303 | - | |
3304 | - //alert('previousSelectedTermList length: ' + $scope.previousSelectedTermList.length); | |
3305 | - | |
3306 | - for (var i = 0; i < $scope.previousSelectedTermList.length; i++) { | |
3307 | - $scope.highLightBodyBasedOnIcolor($scope.previousSelectedTermList[i]); | |
3308 | - | |
3309 | - } | |
3310 | - } | |
3338 | + | |
3339 | + | |
3311 | 3340 | |
3312 | 3341 | } |
3313 | 3342 | ... | ... |