@@ -320,7 +320,12 @@ define([
320320page . appendFormatLine ( '<input type="text" class="{0}" id="{1}" placeholder="{2}"/>' , 'vp-input' , 'vp_feReturn' , 'Variable name' ) ;
321321page . appendLine ( '</div>' ) ;
322322page . appendLine ( '</div>' ) ;
323-
323+ page . appendFormatLine ( '<div class="{0}">' , 'vp-fe-toolbar' ) ;
324+ page . appendFormatLine ( '<button type="button" class="{0}" data-type="{1}">{2}</button>'
325+ , 'vp-button vp-fe-toolbar-item' , FRAME_EDIT_TYPE . ADD_COL , 'Add Column' ) ;
326+ page . appendFormatLine ( '<button type="button" class="{0}" data-type="{1}">{2}</button>'
327+ , 'vp-button vp-fe-toolbar-item' , FRAME_EDIT_TYPE . ADD_ROW , 'Add Row' ) ;
328+ page . appendLine ( '</div>' ) ;
324329// Table
325330page . appendFormatLine ( '<div class="{0} {1}">' , VP_FE_TABLE , 'no-selection' ) ;
326331
@@ -677,7 +682,8 @@ define([
677682var content = new sb . StringBuilder ( ) ;
678683content . appendFormatLine ( '<table class="{0}">' , 'vp-popup-astype-table' ) ;
679684content . appendLine ( '<colgroup><col width="140px"><col width="80px"><col width="*"></colgroup>' ) ;
680- content . appendFormatLine ( '<thead><th>{0}</th><th>{1}</th><th class="{2}">{3}</th></thead>' , 'Column' , 'Data type' , 'vp-orange-text' , 'New data type' ) ;
685+ content . appendFormatLine ( '<thead style="height: 30px"><th>{0}</th><th>{1}</th><th class="{2}">{3}</th></thead>'
686+ , 'Column' , 'Data type' , 'vp-orange-text' , 'New data type' ) ;
681687content . appendLine ( '<tbody>' ) ;
682688this . state . selected . forEach ( ( col , idx ) => {
683689content . appendLine ( '<tr>' ) ;
@@ -1327,6 +1333,7 @@ define([
13271333$ ( document ) . off ( 'click' , this . wrapSelector ( '.' + VP_FE_ADD_COLUMN ) ) ;
13281334$ ( document ) . off ( 'click' , this . wrapSelector ( '.' + VP_FE_ADD_ROW ) ) ;
13291335$ ( document ) . off ( 'click' , this . wrapSelector ( '.' + VP_FE_TABLE_MORE ) ) ;
1336+ $ ( document ) . off ( 'click' , this . wrapSelector ( '.vp-fe-toolbar-item' ) ) ;
13301337$ ( document ) . off ( 'click' , this . wrapSelector ( '.' + VP_FE_MENU_ITEM ) ) ;
13311338$ ( document ) . off ( 'click' , this . wrapSelector ( '.vp-popup-replace-add' ) ) ;
13321339$ ( document ) . off ( 'click' , this . wrapSelector ( '.vp-popup-delete' ) ) ;
@@ -1585,6 +1592,17 @@ define([
15851592that . loadCode ( that . getTypeCode ( FRAME_EDIT_TYPE . SHOW ) ) ;
15861593} ) ;
15871594
1595+ // click toolbar item
1596+ $ ( document ) . on ( 'click' , this . wrapSelector ( '.vp-fe-toolbar-item' ) , function ( ) {
1597+ var itemType = $ ( this ) . data ( 'type' ) ;
1598+ switch ( parseInt ( itemType ) ) {
1599+ case FRAME_EDIT_TYPE . ADD_COL :
1600+ case FRAME_EDIT_TYPE . ADD_ROW :
1601+ that . openInputPopup ( itemType ) ;
1602+ break ;
1603+ }
1604+ } ) ;
1605+
15881606// click menu item
15891607$ ( document ) . on ( 'click' , this . wrapSelector ( '.' + VP_FE_MENU_ITEM ) , function ( event ) {
15901608event . stopPropagation ( ) ;