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

Basic ui #133

Open
wants to merge 2 commits into
base: luwak-server
Choose a base branch
from

Conversation

MichaelKearnsSoftwire
Copy link

Not necessarily desirable to merge, but I'm opening this PR just so you have it around!

console.log(data);
if(data.matches.length > 0) {
// display results
$('#results').append(getGood(data.matches[0]));
Copy link

@ngondard ngondard Dec 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The match url sends an array as a result, while data.matches[0] processes only the first item . May I suggest adapting the getGood function so that it handles an array (see my next comment), then calling it with the whole matches array as a parameter?
$('#results').append(getGood(data.matches));

'<img src="ui/img/found.png">' +
'</div>' +
'<div class="list-right">' +
'<h3> Hurrah - we have found a match and its id is ' + item[0] + '</h3>'
Copy link

@ngondard ngondard Dec 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Herebelow my proposition for parsing the result array. In order to insert a <li> list tag within the existing <li>, I added an <ul> element.

	'<h3>Hurrah - here comes the match list!<ul>'
	// Parses result array in a list
	for(var i in item) {
		output += '<li>id: ' + item[i] + '</li>';
	}
	output += '</ul></h3>';

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

Successfully merging this pull request may close these issues.

None yet

2 participants