Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed a bug with output not showing up when stopping on first error
  • Loading branch information
valueof committed Feb 18, 2011
1 parent aa01514 commit 0fa1373
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
10 changes: 6 additions & 4 deletions index.html
Expand Up @@ -464,10 +464,12 @@ <h4>Errors:</h4>

<ul>
{{each(i, error) errors}}
<li>
<p><strong>Line ${error.line}</strong><code>${error.evidence}</code></p>
<p>${error.reason}</p>
</li>
{{if error}}
<li>
<p><strong>Line ${error.line}</strong><code>${error.evidence}</code></p>
<p>${error.reason}</p>
</li>
{{/if}}
{{/each}}
</ul>
{{/if}}
Expand Down
9 changes: 5 additions & 4 deletions js/core.js
Expand Up @@ -14,6 +14,7 @@ $(document).ready(function () {

output.removeClass("pass");
output.addClass("fail");

output.html(template.tmpl(JSHINT.data()));
}

Expand Down Expand Up @@ -76,13 +77,13 @@ $(document).ready(function () {
if (hasLocalStorage()){
var prefs = localStorage.getItem('prefs');
$("form").unserializeForm(prefs);

$('div.option input').change(function(){
prefs = $(this).closest('form').serialize();
localStorage.setItem('prefs',prefs);
});
}

});


Expand All @@ -93,11 +94,11 @@ $(document).ready(function () {
(function($) {
// takes a GET-serialized string, e.g. first=5&second=3&a=b and sets input tags (e.g. input name="first") to their values (e.g. 5)
$.fn.unserializeForm = function(values) {

if (!values){
return this;
}

values = values.split("&");

var serialized_values = [];
Expand Down

0 comments on commit 0fa1373

Please sign in to comment.