martymarkenson of Ninjas
9/18/2017 - 5:56 PM

This will flash a model-item to show always on top in red then hide the model item

This will flash a model-item to show always on top in red then hide the model item

$scope.app.flashPart = function(part) {
  $scope.view.wdg[part]['decal'] = true;
  if (i++%2 === 0) {
    $scope.view.wdg[part]['opacity'] = 1;
    $scope.view.wdg[part]['visible'] = true;
    $scope.view.wdg[part]['color'] = 'rgba(255,0,0, 1)'; //color code to change the color to red
  }
  else {
    $scope.view.wdg[part]['visible'] = false;
  }
  $scope.$applyAsync();
    
};
  
$scope.app.startFlash = function() {
  interval = setInterval($scope.app.flashPart, 1000, 'modelItem-6'); //model item flashes red every 1000ms(1s)
}

$scope.app.clear = function(){
  clearInterval(interval); //To stop the model item flashing
  $scope.view.wdg['modelItem-6']['decal'] = false;
};