From e737ce214eb59b552e6c7dd074c4f4d719bb31d4 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Sun, 10 Jun 2012 16:32:34 -0700 Subject: Hintable - Array type check fix for arrays created with map() method. --- js/components/hintable.reel/hintable.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'js/components/hintable.reel') diff --git a/js/components/hintable.reel/hintable.js b/js/components/hintable.reel/hintable.js index 803770db..e16c5f8a 100644 --- a/js/components/hintable.reel/hintable.js +++ b/js/components/hintable.reel/hintable.js @@ -185,12 +185,12 @@ exports.Hintable = Montage.create(Editable, { handleInput : { value : function handleInput(e) { this._super(arguments); - + var val = this.value, matches, hint; //console.log('val = "' + val + '"'); //// Handle auto-suggest if configured - if(this.hints instanceof Array) { + if(this.hints && this.hints.length) { if(val.length > 0) { // content is not empty @@ -305,7 +305,8 @@ exports.Hintable = Montage.create(Editable, { /* --------- CONFIG ---------- */ hints : { - value : ['Testing a hint.', 'Testing another hint.', 'Testing the last hint.'] + value : ['Testing a hint.', 'Testing another hint.', 'Testing the last hint.'], + distinct: true }, hintClass : { value : "hintable-hint" -- cgit v1.2.3