   onCreated: ->
     super
 
+    @display = LOI.adventure.interface.display
+
     @currentPageIndex = new ReactiveField 0
-  
+    @pagesCount = new ReactiveField 0
+
   onRendered: ->
     super
 

  writingAreaStyle: ->
    options = @journalDesign.writingAreaOptions()

    # Always show two additional viewport worth of pages, so that
    # there is enough content for scrolling to reach its desired place.
    displayedPages = @currentPageIndex() + 3 * options.pagesPerViewport
    width = displayedPages * options.width + (displayedPages - 1) * options.gap

    left: "#{options.left}rem"


  _updateEntryEditorScrollLeft: ->
    pageIndex = @currentPageIndex()
    scale = @display.scale()
    options = @journalDesign.writingAreaOptions()

    viewportWidth = options.pagesPerViewport * (options.width + options.gap)
