فهرست منبع

Fix loading entries with #fragment path from IndexedDB

Thibaut 11 سال پیش
والد
کامیت
9b1d704e7c
2فایلهای تغییر یافته به همراه4 افزوده شده و 1 حذف شده
  1. 1 1
      assets/javascripts/app/db.coffee
  2. 3 0
      assets/javascripts/models/entry.coffee

+ 1 - 1
assets/javascripts/app/db.coffee

@@ -174,7 +174,7 @@ class app.DB
       txn = db.transaction [entry.doc.slug], 'readonly'
       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.onerror = onError
       @loadDocsCache(db) unless @cachedDocs

+ 3 - 0
assets/javascripts/models/entry.coffee

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