Commit 16df914b authored by GoshaZotov's avatar GoshaZotov

showSpecialPasteOptions / hideSpecialPasteOptions events for show/hide special paste button

parent ec96ed3a
......@@ -706,6 +706,12 @@
if (_canvas)
self.MobileTouchManager.CheckSelect(_canvas.trackOverlay, color);
}
},
"showSpecialPasteOptions": function(val) {
self.handlers.trigger("asc_onShowSpecialPasteOptions", val);
},
"hideSpecialPasteOptions": function() {
self.handlers.trigger("asc_onHideSpecialPasteOptions");
}
});
......
......@@ -8807,6 +8807,11 @@
var _clipboard = window["Asc"]["editor"].wb.clipboard;
var specialPasteProps = _clipboard.specialPasteProps;
if ( val.props && val.props.onlyImages === true ) {
//this.handlers.trigger("showSpecialPasteOptions", autoFilterObject);
return;
}
var callTrigger = false;
if (isLargeRange) {
callTrigger = true;
......@@ -8932,6 +8937,8 @@
History.SetSelection(oSelection);
History.SetSelectionRedo(oSelection);
}
//this.handlers.trigger("showSpecialPasteOptions", autoFilterObject);
};
WorksheetView.prototype._loadDataBeforePaste = function ( isLargeRange, fromBinary, pasteContent, bIsUpdate, canChangeColWidth ) {
......@@ -8982,11 +8989,8 @@
oImageMap[i] = url;
}
}
if ( pasteContent.props.onlyImages !== true )
{
t._pasteData( isLargeRange, fromBinary, pasteContent, bIsUpdate, canChangeColWidth );
}
t._pasteData( isLargeRange, fromBinary, pasteContent, bIsUpdate, canChangeColWidth );
api.wb.clipboard.pasteProcessor._insertImagesFromBinaryWord( t, pasteContent, oImageMap );
isEndTransaction = true;
}
......@@ -8995,12 +8999,9 @@
if(window["NATIVE_EDITOR_ENJINE"])
{
var oImageMap = {};
AscCommon.ResetNewUrls( data, oObjectsForDownload.aUrls, oObjectsForDownload.aBuilderImagesByUrl, oImageMap );
if ( pasteContent.props.onlyImages !== true )
{
t._pasteData( isLargeRange, fromBinary, pasteContent, bIsUpdate, canChangeColWidth );
}
t._pasteData( isLargeRange, fromBinary, pasteContent, bIsUpdate, canChangeColWidth );
api.wb.clipboard.pasteProcessor._insertImagesFromBinaryWord( t, pasteContent, oImageMap );
isEndTransaction = true;
......@@ -9009,12 +9010,11 @@
{
AscCommon.sendImgUrls( api, oObjectsForDownload.aUrls, function ( data ) {
var oImageMap = {};
AscCommon.ResetNewUrls( data, oObjectsForDownload.aUrls, oObjectsForDownload.aBuilderImagesByUrl, oImageMap );
if ( pasteContent.props.onlyImages !== true ) {
t._pasteData( isLargeRange, fromBinary, pasteContent, bIsUpdate, canChangeColWidth );
}
t._pasteData( isLargeRange, fromBinary, pasteContent, bIsUpdate, canChangeColWidth );
api.wb.clipboard.pasteProcessor._insertImagesFromBinaryWord( t, pasteContent, oImageMap );
//закрываем транзакцию, поскольку в setSelectionInfo она не закроется
History.EndTransaction();
}, true );
......@@ -9022,7 +9022,7 @@
}
}
else if ( pasteContent.props.onlyImages !== true )
else
{
t._pasteData( isLargeRange, fromBinary, pasteContent, bIsUpdate, canChangeColWidth );
isEndTransaction = true;
......
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