History

Fix loading entries with #fragment path from IndexedDB

Thibaut committed 11 years ago

Commit 9b1d7041 parent 2eede982 files · +4 −1Browse files

Unified · Split

2 files
  1. assets/javascripts/app/db.coffee +1 −1
  2. assets/javascripts/models/entry.coffee +3 −0
assets/javascripts/app/db.coffee+1−1
@@ -174,7 +174,7 @@ class app.DB · 173 unmodified lines
174174 txn = db.transaction [entry.doc.slug], 'readonly'
175175 store = txn.objectStore(entry.doc.slug)
176176
177− req = store.get(entry.path)
177+ req = store.get(entry.dbPath())
178178 req.onsuccess = -> if req.result then onSuccess(req.result) else onError()
179179 req.onerror = onError
180180 @loadDocsCache(db) unless @cachedDocs
assets/javascripts/models/entry.coffee+3−0
@@ -23,6 +23,9 @@ class app.models.Entry extends app.Model · 22 unmodified lines
2323 fullPath: ->
2424 @doc.fullPath if @isIndex() then '' else @path
2525
26+ dbPath: ->
27+ @path.replace /#.*/, ''
28+
2629 filePath: ->
2730 @doc.fullPath @_filePath()
2831