@@ -81,7 +81,7 @@ define([
81
81
* Component
82
82
*/
83
83
class PopupComponent extends Component {
84
- constructor ( state = { config : { id : 'popup' , name : 'Popup title' , path : 'path/file' } } , prop = { } ) {
84
+ constructor ( state = { config : { id : 'popup' , name : 'Popup title' , path : 'path/file' , category : '' } } , prop = { } ) {
85
85
// CHROME: FIXME: #site -> .notebook-vertical
86
86
// super($('#site'), state, prop);
87
87
super ( $ ( vpConfig . parentSelector ) , state , prop ) ;
@@ -398,6 +398,11 @@ define([
398
398
that . _saveSingleState ( $ ( this ) [ 0 ] ) ;
399
399
} ) ;
400
400
401
+ // click input box with selection
402
+ $ ( document ) . on ( 'focus' , this . wrapSelector ( 'input' ) , function ( ) {
403
+ $ ( this ) . select ( ) ;
404
+ } ) ;
405
+
401
406
// Click buttons
402
407
$ ( this . wrapSelector ( '.vp-popup-button' ) ) . on ( 'click' , function ( evt ) {
403
408
var btnType = $ ( this ) . data ( 'type' ) ;
@@ -492,6 +497,7 @@ define([
492
497
493
498
_unbindEvent ( ) {
494
499
$ ( document ) . off ( 'change' , this . wrapSelector ( '.vp-state' ) ) ;
500
+ $ ( document ) . off ( 'focus' , this . wrapSelector ( 'input' ) ) ;
495
501
}
496
502
497
503
_bindDraggable ( ) {
@@ -544,7 +550,11 @@ define([
544
550
this . $pageDom = $ ( popupComponentHtml . replaceAll ( '${vp_base}' , com_Const . BASE_PATH ) ) ;
545
551
// set title
546
552
// this.$pageDom.find('.vp-popup-title').text(this.category + ' > ' + this.name);
547
- this . $pageDom . find ( '.vp-popup-title' ) . html ( `<span class="vp-popup-category">${ this . category } > </span><span>${ this . name } </span>` ) ;
553
+ if ( this . category && this . category !== '' ) {
554
+ this . $pageDom . find ( '.vp-popup-title' ) . html ( `<span class="vp-popup-category">${ this . category } > </span><span>${ this . name } </span>` ) ;
555
+ } else {
556
+ this . $pageDom . find ( '.vp-popup-title' ) . html ( `<span>${ this . name } </span>` ) ;
557
+ }
548
558
// set body
549
559
let bodyTemplate = this . templateForBody ( ) ;
550
560
// CHROME: check url keyword and replace it
@@ -792,7 +802,9 @@ define([
792
802
if ( customKey && customKey != '' ) {
793
803
// allow custom key until level 2
794
804
let customKeys = customKey . split ( '.' ) ;
795
- if ( customKeys . length == 2 ) {
805
+ if ( customKeys . length === 3 ) {
806
+ this . state [ customKeys [ 0 ] ] [ customKeys [ 1 ] ] [ customKeys [ 2 ] ] = newValue ;
807
+ } else if ( customKeys . length === 2 ) {
796
808
this . state [ customKeys [ 0 ] ] [ customKeys [ 1 ] ] = newValue ;
797
809
} else {
798
810
this . state [ customKey ] = newValue ;
0 commit comments