Browse Source

Make Doc#text the same as Entry#text

Thibaut 10 years ago
parent
commit
13c1588f5a
1 changed files with 2 additions and 2 deletions
  1. 2 2
      assets/javascripts/models/doc.coffee

+ 2 - 2
assets/javascripts/models/doc.coffee

@@ -4,7 +4,7 @@ class app.models.Doc extends app.Model
   constructor: ->
     super
     @reset @
-    @text = @name.toLowerCase()
+    @text = @toEntry().text
 
   reset: (data) ->
     @resetEntries data.entries
@@ -35,7 +35,7 @@ class app.models.Doc extends app.Model
     "#{app.indexHost()}/#{@index_path}?#{@mtime}"
 
   toEntry: ->
-    new app.models.Entry
+    @entry ||= new app.models.Entry
       doc: @
       name: @name
       path: 'index'