bump 0.4.1

This commit is contained in:
qingwei.li 2016-11-28 12:23:43 +08:00
parent d556282471
commit 5953ef7739
3 changed files with 11 additions and 4 deletions

View File

@ -1,3 +1,7 @@
## 0.4.1
## Bug fixes
- catch ajax error
## 0.4.0
### Features
- Custom sidebar

View File

@ -13,7 +13,8 @@ var ajax = function (url, options) {
xhr.send();
return {
then: function (cb) { return xhr.addEventListener('load', cb); }
then: function (cb) { return xhr.addEventListener('load', cb); },
catch: function (cb) { return xhr.addEventListener('error', cb); }
}
};
@ -2293,7 +2294,8 @@ var Docsify = function Docsify (opts) {
Docsify.prototype.load = function load () {
var this$1 = this;
ajax(((this.loc) + ".md")).then(function (res) {
ajax(((this.loc) + ".md"))
.then(function (res) {
var target = res.target;
if (target.status >= 400) {
this$1.render('not found');
@ -2304,7 +2306,8 @@ Docsify.prototype.load = function load () {
this$1.activeNav(document.querySelector('aside.sidebar'), true);
}
}
});
})
.catch(function (_) { return this$1.render('not found'); });
};
Docsify.prototype.render = function render$1 (content) {

2
lib/docsify.min.js vendored

File diff suppressed because one or more lines are too long