Fix loading entries with #fragment path from IndexedDB

pull/165/head
Thibaut 10 years ago
parent 2eede98a14
commit 9b1d704e7c

@ -174,7 +174,7 @@ class app.DB
txn = db.transaction [entry.doc.slug], 'readonly' txn = db.transaction [entry.doc.slug], 'readonly'
store = txn.objectStore(entry.doc.slug) store = txn.objectStore(entry.doc.slug)
req = store.get(entry.path) req = store.get(entry.dbPath())
req.onsuccess = -> if req.result then onSuccess(req.result) else onError() req.onsuccess = -> if req.result then onSuccess(req.result) else onError()
req.onerror = onError req.onerror = onError
@loadDocsCache(db) unless @cachedDocs @loadDocsCache(db) unless @cachedDocs

@ -23,6 +23,9 @@ class app.models.Entry extends app.Model
fullPath: -> fullPath: ->
@doc.fullPath if @isIndex() then '' else @path @doc.fullPath if @isIndex() then '' else @path
dbPath: ->
@path.replace /#.*/, ''
filePath: -> filePath: ->
@doc.fullPath @_filePath() @doc.fullPath @_filePath()

Loading…
Cancel
Save