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
174 txn = db.transaction [entry.doc.slug], 'readonly'174 txn = db.transaction [entry.doc.slug], 'readonly'
175 store = txn.objectStore(entry.doc.slug)175 store = txn.objectStore(entry.doc.slug)
176 176
177 req = store.get(entry.path)177 req = store.get(entry.dbPath())
178 req.onsuccess = -> if req.result then onSuccess(req.result) else onError()178 req.onsuccess = -> if req.result then onSuccess(req.result) else onError()
179 req.onerror = onError179 req.onerror = onError
180 @loadDocsCache(db) unless @cachedDocs180 @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
23 fullPath: ->23 fullPath: ->
24 @doc.fullPath if @isIndex() then '' else @path24 @doc.fullPath if @isIndex() then '' else @path
25 25
26 dbPath: ->
27 @path.replace /#.*/, ''
28
26 filePath: ->29 filePath: ->
27 @doc.fullPath @_filePath()30 @doc.fullPath @_filePath()
28 31