Refactor code.

This commit is contained in:
Lars Jung 2015-04-25 17:10:47 +02:00
parent d5221c0d17
commit 1a47a2aa3b
5 changed files with 33 additions and 40 deletions

View file

@ -23,18 +23,12 @@ modulejs.define('main/info', ['$', 'config'], function ($, config) {
function addTest(label, info, passed, result) {
$(testTemp)
.find('.label')
.text(label)
.end()
.find('.result')
var $test = $(testTemp).appendTo('#tests');
$test.find('.label').text(label);
$test.find('.result')
.addClass(passed ? 'passed' : 'failed')
.text(result ? result : (passed ? 'yes' : 'no'))
.end()
.find('.info')
.html(info)
.end()
.appendTo('#tests');
.text(result ? result : (passed ? 'yes' : 'no'));
$test.find('.info').html(info);
}
function addTests() {