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); }