@@ -320,7 +320,12 @@ define([
320
320
page . appendFormatLine ( '<input type="text" class="{0}" id="{1}" placeholder="{2}"/>' , 'vp-input' , 'vp_feReturn' , 'Variable name' ) ;
321
321
page . appendLine ( '</div>' ) ;
322
322
page . 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>' ) ;
324
329
// Table
325
330
page . appendFormatLine ( '<div class="{0} {1}">' , VP_FE_TABLE , 'no-selection' ) ;
326
331
@@ -677,7 +682,8 @@ define([
677
682
var content = new sb . StringBuilder ( ) ;
678
683
content . appendFormatLine ( '<table class="{0}">' , 'vp-popup-astype-table' ) ;
679
684
content . 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' ) ;
681
687
content . appendLine ( '<tbody>' ) ;
682
688
this . state . selected . forEach ( ( col , idx ) => {
683
689
content . appendLine ( '<tr>' ) ;
@@ -1327,6 +1333,7 @@ define([
1327
1333
$ ( document ) . off ( 'click' , this . wrapSelector ( '.' + VP_FE_ADD_COLUMN ) ) ;
1328
1334
$ ( document ) . off ( 'click' , this . wrapSelector ( '.' + VP_FE_ADD_ROW ) ) ;
1329
1335
$ ( document ) . off ( 'click' , this . wrapSelector ( '.' + VP_FE_TABLE_MORE ) ) ;
1336
+ $ ( document ) . off ( 'click' , this . wrapSelector ( '.vp-fe-toolbar-item' ) ) ;
1330
1337
$ ( document ) . off ( 'click' , this . wrapSelector ( '.' + VP_FE_MENU_ITEM ) ) ;
1331
1338
$ ( document ) . off ( 'click' , this . wrapSelector ( '.vp-popup-replace-add' ) ) ;
1332
1339
$ ( document ) . off ( 'click' , this . wrapSelector ( '.vp-popup-delete' ) ) ;
@@ -1585,6 +1592,17 @@ define([
1585
1592
that . loadCode ( that . getTypeCode ( FRAME_EDIT_TYPE . SHOW ) ) ;
1586
1593
} ) ;
1587
1594
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
+
1588
1606
// click menu item
1589
1607
$ ( document ) . on ( 'click' , this . wrapSelector ( '.' + VP_FE_MENU_ITEM ) , function ( event ) {
1590
1608
event . stopPropagation ( ) ;
0 commit comments