Commit 0800f321 authored by Dmitry.Vikulov's avatar Dmitry.Vikulov Committed by Alexander.Trofimov

timer

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@50722 954022d7-b5bf-4e40-9824-e11837661b57
parent 9bb52539
...@@ -2396,7 +2396,22 @@ function DrawingObjects() { ...@@ -2396,7 +2396,22 @@ function DrawingObjects() {
_this.asyncImagesDocumentEndLoaded = null; _this.asyncImagesDocumentEndLoaded = null;
var wsCellCache = { cols: null, rows: null, isInit: false }; var wsCellCache = { cols: null, rows: null, isInit: false };
var lastDrawTime = getCurrentTime();
// Task timer
var aDrawTasks = [];
var drawTaskTimerId = null;
function drawTaskFunction() {
var taskLen = aDrawTasks.length;
if ( taskLen ) {
//console.log("Task count = " + taskLen);
_this.showDrawingObjectsEx(aDrawTasks[taskLen - 1].params[0], aDrawTasks[taskLen - 1].params[1]);
aDrawTasks.splice(0, (taskLen - 1 > 0) ? taskLen - 1 : 1);
}
}
//----------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------
// Create drawing // Create drawing
...@@ -2682,6 +2697,8 @@ function DrawingObjects() { ...@@ -2682,6 +2697,8 @@ function DrawingObjects() {
_this.init = function(currentSheet) { _this.init = function(currentSheet) {
var taskTimerId = setInterval(drawTaskFunction, 5);
userId = api.User.asc_getId(); userId = api.User.asc_getId();
documentId = api.documentId; documentId = api.documentId;
worksheet = currentSheet; worksheet = currentSheet;
...@@ -3217,6 +3234,17 @@ function DrawingObjects() { ...@@ -3217,6 +3234,17 @@ function DrawingObjects() {
//----------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------
_this.showDrawingObjects = function(clearCanvas, printOptions) { _this.showDrawingObjects = function(clearCanvas, printOptions) {
var currDate = new Date();
var currTime = currDate.getTime();
if ( aDrawTasks.length ) {
if ( currTime - aDrawTasks[aDrawTasks.length - 1].time < 40 )
return;
}
aDrawTasks.push( { time: currTime, params: [clearCanvas, printOptions] } );
}
_this.showDrawingObjectsEx = function(clearCanvas, printOptions) {
/*********** Print Options *************** /*********** Print Options ***************
printOptions : { printOptions : {
...@@ -3224,13 +3252,7 @@ function DrawingObjects() { ...@@ -3224,13 +3252,7 @@ function DrawingObjects() {
printPagesData printPagesData
} }
*****************************************/ *****************************************/
var currentTime = getCurrentTime();
if ( currentTime - lastDrawTime < 20 ) {
//console.log("Skip showDrawingObjects");
return;
}
if ( drawingCtx ) { if ( drawingCtx ) {
if ( clearCanvas ) if ( clearCanvas )
_this.clearDrawingObjects(); _this.clearDrawingObjects();
...@@ -3299,8 +3321,6 @@ function DrawingObjects() { ...@@ -3299,8 +3321,6 @@ function DrawingObjects() {
_this.drawWorksheetHeaders(); _this.drawWorksheetHeaders();
} }
lastDrawTime = getCurrentTime();
} }
_this.getDrawingAreaMetrics = function() { _this.getDrawingAreaMetrics = function() {
......
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