Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map default suggestion items to a url instead #15

Closed
Jarvvski opened this issue Aug 23, 2017 · 2 comments
Closed

Map default suggestion items to a url instead #15

Jarvvski opened this issue Aug 23, 2017 · 2 comments

Comments

@Jarvvski
Copy link

I've been fiddling around in my fork to try and get this, but sadly the suggestions are very deeply imbedded in your code flow and I'm not that great with javascript.

Could we setup a way to define a JSON object where the key is followed by the string that matches the suggestion 'text'? And in turn, build a link based on the suggestion 'url'?

     defaultSuggestions: {
	  	'google': 
			{
				text : 'mail',
				url  : 'https://gmail.com'
			}
			{
				text : 'suggestion2'
				url  : 'https://suggestion55555.com'
			}
	}

I have some really long URL's that I'd like to hide behind the text, otherwise the screen gets very cramped...

@xvvvyz
Copy link
Owner

xvvvyz commented Aug 24, 2017

You can do this as is. Consider the following:

// command
[null, null, 'mail', 'https://gmail.com', null, null]
// default suggestion
'google': ['mail']

@Jarvvski
Copy link
Author

Perfect!

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants