Commit 16df914b authored by GoshaZotov's avatar GoshaZotov

showSpecialPasteOptions / hideSpecialPasteOptions events for show/hide special paste button

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