From 7f56186333680b07ef76feb595b98796f7984552 Mon Sep 17 00:00:00 2001 From: minjk-bl Date: Mon, 8 Aug 2022 15:36:44 +0900 Subject: [PATCH 1/2] Fix Add and Replace column's python code on Frame app --- js/m_apps/Frame.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/m_apps/Frame.js b/js/m_apps/Frame.js index 0b8d9de2..9efe8b28 100644 --- a/js/m_apps/Frame.js +++ b/js/m_apps/Frame.js @@ -1302,12 +1302,12 @@ define([ var tab = content.addtype; if (tab == 'value') { var value = com_util.convertToStr(content.value, content.valueastext); - code.appendFormat("{0}[[{1}]] = {2}", tempObj, name, value); + code.appendFormat("{0}[{1}] = {2}", tempObj, name, value); } else if (tab == 'calculation') { var { var1col, oper, var2col } = content; var var1code = tempObj + "['" + var1col + "']"; var var2code = tempObj + "['" + var2col + "']"; - code.appendFormat('{0}[[{1}]] = {2} {3} {4}', tempObj, name, var1code, oper, var2code); + code.appendFormat('{0}[{1}] = {2} {3} {4}', tempObj, name, var1code, oper, var2code); } else if (tab == 'replace') { var replaceStr = new com_String(); var useRegex = content['useregex']; @@ -1325,7 +1325,7 @@ define([ if (selectedName && selectedName != '') { selectedName = '[[' + selectedName + ']]'; } - code.appendFormat("{0}[[{1}]] = {2}{3}.replace({{4}}", tempObj, name, tempObj, selectedName, replaceStr); + code.appendFormat("{0}[{1}] = {2}{3}.replace({{4}}", tempObj, name, tempObj, selectedName, replaceStr); if (useRegex) { code.append(', regex=True'); } @@ -1334,7 +1334,7 @@ define([ var value = com_util.convertToStr(content.value, content.valueastext); code.appendFormat("{0} = {1}", content.subset, value); } else if (tab == 'apply') { - code.appendFormat("{0}[[{1}]] = {2}[{3}].apply({4})", tempObj, name, tempObj, content.column, content.apply); + code.appendFormat("{0}[{1}] = {2}[{3}].apply({4})", tempObj, name, tempObj, content.column, content.apply); } break; case FRAME_EDIT_TYPE.ADD_ROW: From fd4f0693a500f14620e021a4d14bc5a87c7c81b0 Mon Sep 17 00:00:00 2001 From: minjk-bl Date: Mon, 8 Aug 2022 17:46:37 +0900 Subject: [PATCH 2/2] Fix PopupComponent to prevent top-left position of popup not to be less than 0 --- js/com/component/PopupComponent.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/js/com/component/PopupComponent.js b/js/com/component/PopupComponent.js index 012baf34..1a012ffd 100644 --- a/js/com/component/PopupComponent.js +++ b/js/com/component/PopupComponent.js @@ -792,7 +792,20 @@ define([ open() { vpLog.display(VP_LOG_TYPE.DEVELOP, 'open popup', this); this.loadState(); + this.show(); + + // set popup position if its top-left side is outside of view + let pos = $(this.wrapSelector()).position(); + if (pos) { + if (pos.top < 0) { + $(this.wrapSelector()).css({ top: 0 }); + } + if (pos.left < 0) { + $(this.wrapSelector()).css({ left: 0 }); + } + } + this._bindCodemirror(); $(this.eventTarget).trigger({