Content deleted Content added
style tweaks, show current comment value |
disable inputs on submitting, cannot submit without response, clean up debug logging |
||
Line 84:
*/
EFFPRH.addHandlerLink = function ( $editSectionLinks, reporterName, sectionNum ) {
const $handlerLink = $( '<a>' )
.attr( 'id', 'script-EFFPRH-launch-' + sectionNum )
Line 95 ⟶ 94:
}
$( this ).addClass( 'script-EFFPRH-disabled' );
EFFPRH.showHandler( reporterName, sectionNum );
}
Line 137 ⟶ 135:
responseOptions: EFFPRH.responseOptions,
selectedResponse: 'none',
commentValue: '',
// Overall state
haveSubmitted: false
};
},
computed: {
canSubmit: function () {
return !this.haveSubmitted && this.selectedResponse !== 'none';
}
},
methods: {
Line 145 ⟶ 151:
},
submitHandler: function () {
this.haveSubmitted = true;
console.log( 'Should submit!' );
},
Line 162 ⟶ 169:
<div class="script-EFFPRH-handler">
<p>Section {{ sectionNum }} for report by {{ reporterName }}. Selected response: {{ selectedResponse }}. Comment: {{ commentValue }}.</p>
<wvui-dropdown v-model="selectedResponse" :items="responseOptions" defaultLabel="Response to report" :disabled="!haveSubmitted" />
<wvui-input :value="commentValue" v-on:input="onCommentChange" placeholder="Comment" :disabled="!haveSubmitted" />
<br />
<wvui-button type="primary" action="progressive" :disabled="!canSubmit" v-on:click="submitHandler">Submit</wvui-button>
<wvui-button type="primary" action="destructive" :disabled="!haveSubmitted" v-on:click="cancelHandler">Cancel</wvui-button>
</div>`
};
|