       fn(versions)
       return
 
-    @db (db) ->
+    @db (db) =>
       unless db
         fn(false)
         return
 
-      txn = db.transaction ['docs'], 'readonly'
-      txn.oncomplete = -> fn(result)
+      txn = @idbTransaction db, stores: ['docs'], mode: 'readonly'
+      txn.oncomplete = ->
+        fn(result)
+        return
       store = txn.objectStore('docs')
       result = {}
 

  shouldLoadWithIDB: (entry) ->
    @useIndexedDB and (not @cachedDocs or @cachedDocs[entry.doc.slug])

  reset: ->
    try indexedDB?.deleteDatabase(NAME) catch
    return

        onError()
        return

      txn = @idbTransaction db, stores: ['docs', doc.slug], mode: 'readwrite', ignoreError: false
      txn.oncomplete = =>
        @cachedDocs?[doc.slug] = doc.mtime
        onSuccess()
        return
      txn.onerror = (event) ->
        event.preventDefault()
        onError(event)
        return

      store = txn.objectStore(doc.slug)
