Fixed bugs and updated to latest meteor.
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user