From 4f2ce91bddae96e69ec4b56bb0cd0aaad93b23ff Mon Sep 17 00:00:00 2001 From: hitautodestruct Date: Sun, 5 Mar 2017 10:40:52 +0200 Subject: [PATCH] Added method to programatically trigger results Added a method to programatically trigger results allowing a "drop down" mode when placing a button next to the input. --- auto-complete.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/auto-complete.js b/auto-complete.js index 2f5a88c..c07658f 100644 --- a/auto-complete.js +++ b/auto-complete.js @@ -126,6 +126,19 @@ var autoComplete = (function(){ else that.sc.style.display = 'none'; } + + // Optional method to trigger results programatically + that.triggerSC = function(data){ + + if (data.length) { + var s = ''; + for (var i=0;i