@@ -267,8 +267,8 @@ class EdgeEditor extends UNISYS.Component {
267
267
this . onCitationChange = this . onCitationChange . bind ( this ) ;
268
268
this . onCategoryChange = this . onCategoryChange . bind ( this ) ;
269
269
this . onSubmit = this . onSubmit . bind ( this ) ;
270
- this . checkUnload = this . checkUnload . bind ( this ) ;
271
- this . doUnload = this . doUnload . bind ( this ) ;
270
+ this . checkUnload = this . checkUnload . bind ( this ) ;
271
+ this . doUnload = this . doUnload . bind ( this ) ;
272
272
273
273
// Always make sure class methods are bind()'d before using them
274
274
// as a handler, otherwise object context is lost
@@ -639,9 +639,9 @@ class EdgeEditor extends UNISYS.Component {
639
639
640
640
} // this.onCloseCiteClick
641
641
642
- dateFormatted ( ) {
642
+ dateFormatted ( ) {
643
643
var today = new Date ( ) ;
644
- var year = "" + today . getFullYear ( ) ;
644
+ var year = String ( today . getFullYear ( ) ) ;
645
645
var date = ( today . getMonth ( ) + 1 ) + "/" + today . getDate ( ) + "/" + year . substr ( 2 , 4 ) ;
646
646
var time = today . toTimeString ( ) . substr ( 0 , 5 ) ;
647
647
var dateTime = time + ' on ' + date ;
@@ -818,16 +818,14 @@ class EdgeEditor extends UNISYS.Component {
818
818
const { edgeID, parentNodeLabel } = this . props ;
819
819
const { formData, sourceNode, targetNode, edgePrompts} = this . state ;
820
820
let { citationPrompts} = this . state ;
821
- if ( edgePrompts . category == undefined ) // for backwards compatability
822
- {
821
+ if ( edgePrompts . category === undefined ) { // for backwards compatability
823
822
edgePrompts . category = { } ;
824
823
edgePrompts . category . label = "" ;
825
824
edgePrompts . category . hidden = true ;
826
825
}
827
- if ( citationPrompts == undefined ) // if citationPrompts were lefft out, simply make them hidden
828
- {
829
- citationPrompts = { } ;
830
- citationPrompts . hidden = true ;
826
+ if ( citationPrompts === undefined ) { // if citationPrompts were left out, simply make them hidden
827
+ citationPrompts = { } ;
828
+ citationPrompts . hidden = true ;
831
829
}
832
830
const me = < span style = { { color : "rgba(0,0,0,0.2)" , fontStyle : "italic" } } > this node</ span > ;
833
831
// special override to allow editing an edge that has the same parent node for both source and target
@@ -1010,21 +1008,17 @@ class EdgeEditor extends UNISYS.Component {
1010
1008
window . addEventListener ( "unload" , this . doUnload ) ;
1011
1009
}
1012
1010
1013
- checkUnload ( e )
1014
- {
1015
- if ( this . state . isEditable )
1016
- {
1017
- ( e || window . event ) . returnValue = null ;
1018
- return null ;
1019
- }
1011
+ checkUnload ( e ) {
1012
+ if ( this . state . isEditable ) {
1013
+ ( e || window . event ) . returnValue = null ;
1014
+ return null ;
1015
+ }
1020
1016
}
1021
1017
1022
- doUnload ( e )
1023
- {
1024
- if ( this . state . isEditable )
1025
- {
1026
- this . NetCall ( 'SRV_DBUNLOCKEDGE' , { edgeID : this . state . formData . id } )
1027
- }
1018
+ doUnload ( e ) {
1019
+ if ( this . state . isEditable ) {
1020
+ this . NetCall ( 'SRV_DBUNLOCKEDGE' , { edgeID : this . state . formData . id } )
1021
+ }
1028
1022
}
1029
1023
1030
1024
/// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -1053,33 +1047,30 @@ class EdgeEditor extends UNISYS.Component {
1053
1047
/*/
1054
1048
/*/
1055
1049
1056
- helpText ( obj )
1057
- {
1058
- var text = "" ;
1059
-
1060
- if ( obj . help == undefined || obj . help == "" )
1061
- text = obj . label ;
1062
- else
1063
- text = obj . help ;
1064
- return text ;
1065
- }
1066
-
1067
-
1068
- markdownDisplay ( text ) {
1050
+ helpText ( obj ) {
1051
+ var text = "" ;
1052
+ if ( obj . help === undefined || obj . help === "" ) text = obj . label ;
1053
+ else text = obj . help ;
1054
+ return text ;
1055
+ }
1069
1056
1070
- if ( ! this . state . isEditable )
1071
- return mdReact ( { onIterate : this . markdownIterate , markdownOptions :{ typographer : true , linkify : true } , plugins : [ mdplugins . emoji ]
1072
- } ) ( text ) ;
1073
- }
1074
1057
1075
- markdownIterate ( Tag , props , children , level ) {
1076
- if ( Tag === 'a' ) {
1077
- props . target = '_blank' ;
1058
+ markdownDisplay ( text ) {
1059
+ if ( ! this . state . isEditable ) {
1060
+ return mdReact ( {
1061
+ onIterate : this . markdownIterate ,
1062
+ markdownOptions : { typographer : true , linkify : true } ,
1063
+ plugins : [ mdplugins . emoji ]
1064
+ } ) ( text ) ;
1065
+ }
1078
1066
}
1079
1067
1080
- return < Tag { ...props } > { children } </ Tag > ;
1081
-
1082
- }
1068
+ markdownIterate ( Tag , props , children , level ) {
1069
+ if ( Tag === 'a' ) {
1070
+ props . target = '_blank' ;
1071
+ }
1072
+ return < Tag { ...props } > { children } </ Tag > ;
1073
+ }
1083
1074
1084
1075
} // class EdgeEditor
1085
1076
0 commit comments