Commit e71fe0bd authored by GoshaZotov's avatar GoshaZotov

add functions for change special paste icon position

parent 8c2683f3
......@@ -251,6 +251,9 @@
this.specialPasteStart = false;
this.bIsEndTransaction = false;//если нужно сделать на end_paste endTransaction
this.showSpecialPasteButton = false;//нужно показывать или нет кнопку специальной вставки
this.specialPasteRange = null;//для того, чтобы показать в нужном месте иконку(кнопку) специальной вставки
return this;
}
......@@ -446,6 +449,44 @@
this.specialPasteStart = true;
//console.log("specialPasteStart: " + this.specialPasteStart);
},
showSpecialPasteOptions: function(ws, props, range)
{
var specialPasteShowOptions = new Asc.SpecialPasteShowOptions();
this.specialPasteRange = range;
var isVisible = null !== ws.getCellVisibleRange(range.c2, range.r2);
var cellCoord = ws.getCellCoord(range.c2, range.r2);
if(!isVisible)
{
cellCoord._x = -1;
cellCoord._y = -1;
}
specialPasteShowOptions.asc_setOptions(props);
specialPasteShowOptions.asc_setCellCoord(cellCoord);
ws.handlers.trigger("showSpecialPasteOptions", specialPasteShowOptions);
},
updateSpecialPasteOptionsPosition: function(ws)
{
if(this.showSpecialPasteButton && this.specialPasteRange)
{
var specialPasteShowOptions = new Asc.SpecialPasteShowOptions();
var range = this.specialPasteRange;
var isVisible = null !== ws.getCellVisibleRange(range.c2, range.r2);
var cellCoord = ws.getCellCoord(range.c2, range.r2);
if(!isVisible)
{
cellCoord._x = -1;
cellCoord._y = -1;
}
specialPasteShowOptions.asc_setCellCoord(cellCoord);
ws.handlers.trigger("showSpecialPasteOptions", specialPasteShowOptions);
}
}
};
......
......@@ -711,7 +711,10 @@
},
"showSpecialPasteOptions": function(val) {
self.handlers.trigger("asc_onShowSpecialPasteOptions", val);
//console.log("showSpecialPasteOptions");
if(!window["Asc"]["editor"].wb.clipboard.showSpecialPasteButton)
{
window["Asc"]["editor"].wb.clipboard.showSpecialPasteButton = true;
}
}
});
......@@ -826,8 +829,11 @@
return !self.isShowComments;
});
this.model.handlers.add("hideSpecialPasteOptions", function() {
if(window["Asc"]["editor"].wb.clipboard.showSpecialPasteButton)
{
self.handlers.trigger("asc_onHideSpecialPasteOptions");
//console.log("hideSpecialPasteOptions");
window["Asc"]["editor"].wb.clipboard.showSpecialPasteButton = false;
}
});
this.cellCommentator = new AscCommonExcel.CCellCommentator({
......
......@@ -5605,6 +5605,7 @@
//ToDo this.drawDepCells();
this.cellCommentator.updateCommentPosition();
this.cellCommentator.drawCommentCells();
window["Asc"]["editor"].wb.clipboard.updateSpecialPasteOptionsPosition(this);
return this;
};
......@@ -8974,7 +8975,7 @@
//for special paste
if(!window["Asc"]["editor"].wb.clipboard.specialPasteStart)
{
var specialPasteShowOptions = new Asc.SpecialPasteShowOptions();
//var specialPasteShowOptions = new Asc.SpecialPasteShowOptions();
var allowedSpecialPasteProps;
var sProps = Asc.c_oSpecialPasteProps;
if(fromBinary)
......@@ -8986,11 +8987,7 @@
//matchDestinationFormatting - пока не добавляю, так как работает как и values
allowedSpecialPasteProps = [sProps.sourceformatting, sProps.destinationFormatting];
}
specialPasteShowOptions.asc_setOptions(allowedSpecialPasteProps);
var cellCoord = this.getCellCoord(selectData[0].c2, selectData[0].r2);
specialPasteShowOptions.asc_setCellCoord(cellCoord);
this.handlers.trigger("showSpecialPasteOptions", specialPasteShowOptions);
_clipboard.showSpecialPasteOptions(this, allowedSpecialPasteProps, selectData[0]);
}
};
......
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