@@ -42,8 +42,19 @@ define(['marionette',
4242 this . strat = null
4343 this . ap = null
4444 this . dp = null
45+ this . showStrategies = true
46+ this . showProcessing = true
47+ this . setProcessingVars ( )
4548 } ,
46-
49+
50+ setProcessingVars : function ( ) {
51+ const hasProcessing = this . model . get ( 'AXISRANGE' ) > 0 || this . model . get ( 'DCT' ) === "Serial Fixed" || this . model . get ( 'DCT' ) === "Serial Jet"
52+ const isCharacterization = this . model . get ( 'DCT' ) === "Characterization"
53+ const hasStrategies = this . model . get ( 'AXISRANGE' ) > 0 && this . model . get ( 'OVERLAP' ) != 0
54+ this . showStrategies = isCharacterization || hasStrategies
55+ this . showProcessing = isCharacterization || ( ! hasStrategies && hasProcessing )
56+ } ,
57+
4758 onShow : function ( ) {
4859 // element not always available at this point?
4960 var w = 0.175 * $ ( window ) . width ( ) * 0.95
@@ -62,17 +73,13 @@ define(['marionette',
6273 // edit.create('COMMENTS', 'text')
6374
6475 this . imagestatus = new ( this . getOption ( 'imageStatusItem' ) ) ( { ID : this . model . get ( 'ID' ) , TYPE : this . model . get ( 'DCT' ) , statuses : this . getOption ( 'imagestatuses' ) , el : this . $el } )
65- const isCharacterization = this . model . get ( 'DCT' ) === "Characterization"
66- const hasStrategies = this . model . get ( 'AXISRANGE' ) > 0 && this . model . get ( 'OVERLAP' ) != 0
67- const hasProcessing = this . model . get ( 'AXISRANGE' ) > 0 || this . model . get ( 'DCT' ) === "Serial Fixed" || this . model . get ( 'DCT' ) === "Serial Jet"
68- const showStrategies = isCharacterization || hasStrategies
69- const showProcessing = isCharacterization || ( ! hasStrategies && hasProcessing )
70- if ( ! showStrategies ) this . ui . strat . hide ( )
71- if ( ! showProcessing ) {
76+ if ( ! this . showStrategies ) this . ui . strat . hide ( )
77+ if ( ! this . showProcessing ) {
7278 this . ui . ap . hide ( ) ;
7379 this . ui . dp . hide ( ) ;
7480 }
75- this . apstatus = new ( this . getOption ( 'apStatusItem' ) ) ( { ID : this . model . get ( 'ID' ) , showStrategies : showStrategies , showProcessing : showProcessing , statuses : this . getOption ( 'apstatuses' ) , el : this . $el } )
81+
82+ this . apstatus = new ( this . getOption ( 'apStatusItem' ) ) ( { ID : this . model . get ( 'ID' ) , showStrategies : this . showStrategies , showProcessing : this . showProcessing , statuses : this . getOption ( 'apstatuses' ) , el : this . $el } )
7683 this . listenTo ( this . apstatus , 'status' , this . updateAP , this )
7784 this . apmessagestatus = new ( this . getOption ( 'apMessageStatusItem' ) ) ( { ID : this . model . get ( 'ID' ) , statuses : this . getOption ( 'apmessagestatuses' ) , el : this . $el } )
7885
0 commit comments