From cddb07ca625fb1609343d3103673a22b84852cfc Mon Sep 17 00:00:00 2001 From: flowerField Date: Thu, 3 Jun 2021 15:48:26 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=9B=BE=E7=89=87=E8=B7=A8?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E8=A1=A8=E7=B2=98=E8=B4=B4=E5=92=8C=E5=8F=B3?= =?UTF-8?q?=E9=94=AE=E7=B2=98=E8=B4=B4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/imageCtrl.js | 4 ++++ src/controllers/selection.js | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/controllers/imageCtrl.js b/src/controllers/imageCtrl.js index 64de45b..949c13e 100644 --- a/src/controllers/imageCtrl.js +++ b/src/controllers/imageCtrl.js @@ -895,6 +895,10 @@ const imageCtrl = { pasteImgItem: function() { let _this = this; + if(_this.images == null){ + _this.images = {}; + } + let rowIndex = Store.luckysheet_select_save[0].row_focus || 0; let colIndex = Store.luckysheet_select_save[0].column_focus || 0; let left = colIndex == 0 ? 0 : Store.visibledatacolumn[colIndex - 1]; diff --git a/src/controllers/selection.js b/src/controllers/selection.js index 0c1e0aa..1dba06f 100644 --- a/src/controllers/selection.js +++ b/src/controllers/selection.js @@ -15,6 +15,7 @@ import { getSheetIndex } from '../methods/get'; import { replaceHtml, getObjType, luckysheetfontformat } from '../utils/util'; import Store from '../store'; import locale from '../locale/locale'; +import imageCtrl from './imageCtrl'; const selection = { clearcopy: function (e) { @@ -596,6 +597,9 @@ const selection = { _this.pasteHandlerOfCopyPaste(Store.luckysheet_copy_save); } } + else if(data.indexOf("luckysheet_copy_action_image") > - 1){ + imageCtrl.pasteImgItem(); + } else if (triggerType != "btn") { _this.pasteHandler(data); }