From 0fface77aeb55a4f2b7367cd44627b36331e6b6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Khalid=20Salom=C3=A3o?= Date: Wed, 25 Feb 2015 13:39:11 -0300 Subject: [PATCH 1/2] Add error javascript hook --- flatdoc.js | 1 + 1 file changed, 1 insertion(+) diff --git a/flatdoc.js b/flatdoc.js index 19bbf2e..cdf2d0f 100644 --- a/flatdoc.js +++ b/flatdoc.js @@ -458,6 +458,7 @@ $(doc.root).trigger('flatdoc:loading'); doc.fetcher(function(err, markdown) { if (err) { + $(doc.root).trigger('flatdoc:error', err); console.error('[Flatdoc] fetching Markdown data failed.', err); return; } From 810c5828aef0422a5c03b080878e68e0de6ecf82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Khalid=20Salom=C3=A3o?= Date: Wed, 25 Feb 2015 13:40:22 -0300 Subject: [PATCH 2/2] Update readme with new error hook --- Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index 0967599..f02cf42 100644 --- a/Readme.md +++ b/Readme.md @@ -190,7 +190,7 @@ Here are some ideas to get you started. ### JavaScript hooks -Flatdoc emits the events `flatdoc:loading` and `flatdoc:ready` to help you make +Flatdoc emits the events `flatdoc:loading`, `flatdoc:error` and `flatdoc:ready` to help you make custom behavior when the document loads. ``` js