Showing the changes to assets/javascripts (2 of 2 files). Show all
Unified · Split
| @@ -60,7 +60,9 @@ class app.DB · 59 unmodified lines | ||
| 60 | 60 | return |
| 61 | 61 | |
| 62 | 62 | txn = db.transaction ['docs', doc.slug], 'readwrite' |
| 63 | − txn.oncomplete = -> if txn.error then onError() else onSuccess() | |
| 63 | + txn.oncomplete = -> | |
| 64 | + if txn.error then onError() else onSuccess() | |
| 65 | + return | |
| 64 | 66 | |
| 65 | 67 | store = txn.objectStore(doc.slug) |
| 66 | 68 | store.clear() |
| @@ -78,7 +80,9 @@ class app.DB · 11 unmodified lines | ||
| 78 | 80 | return |
| 79 | 81 | |
| 80 | 82 | txn = db.transaction ['docs', doc.slug], 'readwrite' |
| 81 | − txn.oncomplete = -> if txn.error then onError() else onSuccess() | |
| 83 | + txn.oncomplete = -> | |
| 84 | + if txn.error then onError() else onSuccess() | |
| 85 | + return | |
| 82 | 86 | |
| 83 | 87 | store = txn.objectStore(doc.slug) |
| 84 | 88 | store.clear() |
| @@ -154,6 +158,7 @@ class app.DB · 69 unmodified lines | ||
| 154 | 158 | |
| 155 | 159 | reset: -> |
| 156 | 160 | try indexedDB?.deleteDatabase(NAME) catch |
| 161 | + return | |
| 157 | 162 | |
| 158 | 163 | useIndexedDB: -> |
| 159 | 164 | !app.isSingleDoc() and !!window.indexedDB |
| @@ -54,6 +54,7 @@ class app.models.Doc extends app.Model · 53 unmodified lines | ||
| 54 | 54 | @reset data |
| 55 | 55 | onSuccess() |
| 56 | 56 | @_setCache data if options.writeCache |
| 57 | + return | |
| 57 | 58 | |
| 58 | 59 | ajax |
| 59 | 60 | url: @indexUrl() |
| @@ -70,6 +71,7 @@ class app.models.Doc extends app.Model · 10 unmodified lines | ||
| 70 | 71 | callback = => |
| 71 | 72 | @reset data |
| 72 | 73 | onSuccess() |
| 74 | + return | |
| 73 | 75 | |
| 74 | 76 | setTimeout callback, 0 |
| 75 | 77 | true |
| @@ -94,10 +96,12 @@ class app.models.Doc extends app.Model · 18 unmodified lines | ||
| 94 | 96 | error = => |
| 95 | 97 | @downloading = null |
| 96 | 98 | onError() |
| 99 | + return | |
| 97 | 100 | |
| 98 | 101 | success = (data) => |
| 99 | 102 | @downloading = null |
| 100 | 103 | app.db.store @, data, onSuccess, error |
| 104 | + return | |
| 101 | 105 | |
| 102 | 106 | ajax |
| 103 | 107 | url: @dbUrl() |
| @@ -112,13 +116,17 @@ class app.models.Doc extends app.Model · 8 unmodified lines | ||
| 112 | 116 | success = => |
| 113 | 117 | @downloading = null |
| 114 | 118 | onSuccess() |
| 119 | + return | |
| 115 | 120 | |
| 116 | 121 | error = => |
| 117 | 122 | @downloading = null |
| 118 | 123 | onError() |
| 124 | + return | |
| 119 | 125 | |
| 120 | 126 | app.db.unstore @, success, error |
| 127 | + return | |
| 121 | 128 | |
| 122 | 129 | getDownloadStatus: (callback) -> |
| 123 | 130 | app.db.version @, (value) -> |
| 124 | 131 | callback downloaded: !!value, version: value |
| 132 | + return | |