diff --git a/js/com/com_Config.js b/js/com/com_Config.js index 9ae4c62b..c67cdd8b 100644 --- a/js/com/com_Config.js +++ b/js/com/com_Config.js @@ -587,7 +587,7 @@ define([ /** * Version */ - Config.version = "2.2.11"; + Config.version = "2.2.12"; /** * Type of mode diff --git a/js/com/com_Const.js b/js/com/com_Const.js index 1f8401c0..f361a617 100644 --- a/js/com/com_Const.js +++ b/js/com/com_Const.js @@ -19,7 +19,7 @@ define ([ class Constants { } Constants.TOOLBAR_BTN_INFO = { - HELP: "Visual Python 2.2.11" + HELP: "Visual Python 2.2.12" , ICON: "vp-main-icon" , ID: "vpBtnToggle" , NAME: "toggle-vp" 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({ 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: