From e8748dfbcdce70b6bfd8494c0cebc30c2689a24f Mon Sep 17 00:00:00 2001 From: Xcat Liu Date: Wed, 18 May 2016 17:43:04 +0800 Subject: [PATCH 1/2] Fix coding style in docs/async.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 这一篇由于引入了其他源码,所以我改动比较保守,只改了明显可以改进的地方 --- docs/async.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/async.md b/docs/async.md index afca50d..080a5d3 100644 --- a/docs/async.md +++ b/docs/async.md @@ -498,7 +498,7 @@ co函数返回一个Promise对象,因此可以用then方法添加回调函数 ```javascript co(gen).then(function (){ console.log('Generator 函数执行完成'); -}) +}); ``` 上面代码中,等到Generator函数执行结束,就会输出一行提示。 @@ -552,7 +552,7 @@ g.next().value.then(function(data){ g.next(data).value.then(function(data){ g.next(data); }); -}) +}); ``` 手动执行其实就是用then方法,层层添加回调函数。理解了这一点,就可以写出一个自动执行器。 @@ -863,7 +863,7 @@ async function foo() {} const foo = async function () {}; // 对象的方法 -let obj = { async foo() {} } +let obj = { async foo() {} }; // 箭头函数 const foo = async () => {}; @@ -1000,7 +1000,7 @@ function chainAnimationsPromise(elem, animations) { p = p.then(function(val) { ret = val; return anim(elem); - }) + }); } // 返回一个部署了错误捕捉机制的Promise @@ -1029,7 +1029,7 @@ function chainAnimationsGenerator(elem, animations) { } catch(e) { /* 忽略错误,继续执行 */ } - return ret; + return ret; }); } From bdff954876511c33929fb1789c1800cef0da2ddd Mon Sep 17 00:00:00 2001 From: xcatliu Date: Wed, 18 May 2016 18:59:08 +0900 Subject: [PATCH 2/2] Fix code css --- css/app.css | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/css/app.css b/css/app.css index a582ecc..fe21dc7 100644 --- a/css/app.css +++ b/css/app.css @@ -2,14 +2,14 @@ /* Small screens (default) */ html { font-size: 100%; } - + /* Medium screens (640px) */ -@media (min-width: 40rem) { +@media (min-width: 40rem) { html { font-size: 112%; } } - + /* Large screens (1024px) */ -@media (min-width: 64rem) { +@media (min-width: 64rem) { html { font-size: 120%; } } @@ -139,7 +139,7 @@ input.searchButton { /* border: 1px solid black; */ - counter-reset: section; + counter-reset: section; } @media (min-width: 40rem) { @@ -166,9 +166,6 @@ input.searchButton { } #content code { - padding-left: 3px; - padding-right: 3px; - color: #a6e22e; font-size: 0.7rem; font-weight: normal; @@ -178,10 +175,12 @@ input.searchButton { border-radius: 2px; } -#content p>code, +#content p code, #content li>code, #content h2>code, #content h3>code{ + padding-left: 3px; + padding-right: 3px; color: #c7254e; background: #f9f2f4; } @@ -361,7 +360,7 @@ input.searchButton { margin-left: 560px; font-size: 14px; - } + } } #flip{