Fixed bugs and updated to latest meteor.

This commit is contained in:
Wynne Crisman
2020-09-20 20:36:45 -07:00
parent a20e42e360
commit 54cf6c0f6b
13 changed files with 250 additions and 171 deletions

View File

@@ -457,6 +457,30 @@ Template.InsertSale.events({
}
}
});
},
"click .speechLink": function(event, template) {
try {
let SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition;
let r = new SpeechRecognition();
r.lang='en-US';
r.interimResult = false;
r.maxAlternatives = 0;
r.start();
r.onresult = function(event) {
let product = template.$('input[name="product"]');
product.val(event.results[0][0].transcript);
let combo = product.data("de.combo");
combo.show();
combo.filter();
//Count the number of leaf nodes that are visible.
combo.$list.find('li.visible[role="leaf"]').length
}
}
catch(e) {
console.error(e);
}
}
});
Template.InsertSale.helpers({