diff --git a/visualpython/css/m_apps/frame.css b/visualpython/css/m_apps/frame.css index 8661f4af..360fbadb 100644 --- a/visualpython/css/m_apps/frame.css +++ b/visualpython/css/m_apps/frame.css @@ -170,8 +170,10 @@ /* background: rgba(66, 165, 245, 0.2); */ } .vp-fe-table-column-isnumeric { - float: left; margin-right: 5px; + vertical-align: middle; + height: 15px; + line-height: 15px; } /* Row Hover */ diff --git a/visualpython/js/m_apps/Frame.js b/visualpython/js/m_apps/Frame.js index 6452ddf6..438dfc79 100644 --- a/visualpython/js/m_apps/Frame.js +++ b/visualpython/js/m_apps/Frame.js @@ -88,7 +88,7 @@ define([ { id: 'delete', label: 'Delete', selection: FRAME_SELECT_TYPE.MULTI, menuType: FRAME_EDIT_TYPE.DROP }, { id: 'rename', label: 'Rename', selection: FRAME_SELECT_TYPE.NONE, menuType: FRAME_EDIT_TYPE.RENAME }, { id: 'as_type', label: 'As type', selection: FRAME_SELECT_TYPE.NONE, axis: FRAME_AXIS.COLUMN, menuType: FRAME_EDIT_TYPE.AS_TYPE }, - { id: 'to_datetime', label: 'To datetime', selection: FRAME_SELECT_TYPE.SINGLE, axis: FRAME_AXIS.COLUMN, menuType: FRAME_EDIT_TYPE.TO_DATETIME }, + { id: 'to_datetime', label: 'To Datetime', selection: FRAME_SELECT_TYPE.SINGLE, axis: FRAME_AXIS.COLUMN, menuType: FRAME_EDIT_TYPE.TO_DATETIME }, { id: 'replace', label: 'Replace', selection: FRAME_SELECT_TYPE.SINGLE, axis: FRAME_AXIS.COLUMN, menuType: FRAME_EDIT_TYPE.REPLACE }, { id: 'discretize', label: 'Discretize', selection: FRAME_SELECT_TYPE.SINGLE, axis: FRAME_AXIS.COLUMN, numeric_only: true, menuType: FRAME_EDIT_TYPE.DISCRETIZE } ] @@ -724,6 +724,10 @@ define([ $(this.wrapSelector('.vp-inner-popup-fillvalue')).focus(); return; } + } else if (type === FRAME_EDIT_TYPE.TO_DATETIME) { + if (content.newcol === '') { + $(this.wrapSelector('.vp-inner-popup-todt-new-col')).focus(); + } } // run check modules for outliers and load codes if (type === FRAME_EDIT_TYPE.FILL_OUT) { @@ -1126,16 +1130,6 @@ define([ } }); - // bind event for checking add column - $(this.wrapSelector('.vp-inner-popup-todt-use-addcol')).on('change', function() { - let checked = $(this).prop('checked'); - if (checked === true) { - $(that.wrapSelector('.vp-inner-popup-todt-addcol-box')).show(); - } else { - $(that.wrapSelector('.vp-inner-popup-todt-addcol-box')).hide(); - } - }); - // Add column set event $(this.wrapSelector('.vp-inner-popup-todt-addcol')).on('click', function() { let dateTypeList = [ // df[col].dt[{dateType}] @@ -1159,7 +1153,7 @@ define([ }); let addColItemTag = $(`