Skip to content

Commit

Permalink
Fixes issue rlidwka#128 (Sinopia crash after click in web UI)
Browse files Browse the repository at this point in the history
  • Loading branch information
vne committed Sep 24, 2014
1 parent ef074f8 commit 74543b4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/index-web.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ module.exports = function(app, config, storage) {

app.get('/-/readme/:package/:version', function(req, res, next) {
storage.get_readme(req.params.package, req.params.version, function(readme) {
res.send(marked(readme))
readme instanceof Error ? res.send(404) : res.send(marked(readme))
})
})
}
Expand Down
11 changes: 10 additions & 1 deletion lib/static/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,15 @@ $(function() {

$entry.height(height + $readme.outerHeight());

transitionComplete(function() {
$entry.css('height', 'auto');
});
},
error: function(jqxhr, status, error) {
var $readme = $("<div class='readme'>No README file</div>").appendTo($entry);

$entry.height(height + $readme.outerHeight());

transitionComplete(function() {
$entry.css('height', 'auto');
});
Expand Down Expand Up @@ -962,4 +971,4 @@ module.exports = onScroll;
})(typeof window != 'undefined' ? window : global);

}).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{}]},{},[4])
},{}]},{},[4])

0 comments on commit 74543b4

Please sign in to comment.