|
@@ -119,6 +119,27 @@
|
|
saveVisitForm(_trigger, true, true);
|
|
saveVisitForm(_trigger, true, true);
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+ window.initRequestToAddAProblem = function(){
|
|
|
|
+ //On any input/select etc, add these attribute:
|
|
|
|
+ // data-problem="Sneezing"
|
|
|
|
+ // data-problem-value="Yes" Note: this is the value to compare with to trigger problems center popup
|
|
|
|
+
|
|
|
|
+ var problemInput = $('[data-problem]');
|
|
|
|
+ problemInput.on('change', function(e){
|
|
|
|
+ var input = e.target;
|
|
|
|
+ var value = input.value;
|
|
|
|
+ var isProblemIfAnswerIs = $(input).data('problem-value');
|
|
|
|
+ if(value === isProblemIfAnswerIs){
|
|
|
|
+ if (confirm("Do you want to add this as a problem?") == true) {
|
|
|
|
+ $('#active-problems').click();
|
|
|
|
+ } else {
|
|
|
|
+ //Do nothing for now
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ };
|
|
|
|
+
|
|
function initRTEs(_parent) {
|
|
function initRTEs(_parent) {
|
|
_parent.find('[note-rte]:not(.ql-container)').each(function() {
|
|
_parent.find('[note-rte]:not(.ql-container)').each(function() {
|
|
|
|
|
|
@@ -196,6 +217,7 @@
|
|
}
|
|
}
|
|
|
|
|
|
function init() {
|
|
function init() {
|
|
|
|
+ initRequestToAddAProblem();
|
|
|
|
|
|
$(document)
|
|
$(document)
|
|
.off('input.auto-grow', '[visit-moe] form textarea')
|
|
.off('input.auto-grow', '[visit-moe] form textarea')
|