Unified · Split
| @@ -145,6 +145,9 @@ · 144 unmodified lines | |||
| 145 | getComputedStyle(document.querySelector('._header')).backgroundImage isnt 'none' | 145 | getComputedStyle(document.querySelector('._header')).backgroundImage isnt 'none' |
| 146 | catch | 146 | catch |
| 147 | 147 | ||
| 148 | isSingleDoc: -> | ||
| 149 | !!(@DOC or @doc) | ||
| 150 | |||
| 148 | isMobile: -> | 151 | isMobile: -> |
| 149 | # Need to sniff the user agent because some Android and Windows Phone devices don't take | 152 | # Need to sniff the user agent because some Android and Windows Phone devices don't take |
| 150 | # resolution (dpi) into account when reporting device width/height. | 153 | # resolution (dpi) into account when reporting device width/height. |
| @@ -23,7 +23,7 @@ class app.views.RootPage extends app.View · 22 unmodified lines | |||
| 23 | return | 23 | return |
| 24 | 24 | ||
| 25 | isHidden: -> | 25 | isHidden: -> |
| 26 | app.doc or app.store.get 'hideIntro' | 26 | app.isSingleDoc() or app.store.get 'hideIntro' |
| 27 | 27 | ||
| 28 | onRoute: -> | 28 | onRoute: -> |
| 29 | 29 | ||
| @@ -23,7 +23,7 @@ class app.views.Document extends app.View · 22 unmodified lines | |||
| 23 | app.router.show '/help#shortcuts' | 23 | app.router.show '/help#shortcuts' |
| 24 | 24 | ||
| 25 | onEscape: -> | 25 | onEscape: -> |
| 26 | if app.doc then window.location = '/' else app.router.show '/' | 26 | if app.isSingleDoc() then window.location = '/' else app.router.show '/' |
| 27 | 27 | ||
| 28 | onBack: -> | 28 | onBack: -> |
| 29 | history.back() | 29 | history.back() |
| @@ -31,7 +31,7 @@ class app.views.DocList extends app.View · 30 unmodified lines | |||
| 31 | 31 | ||
| 32 | render: => | 32 | render: => |
| 33 | @html @tmpl('sidebarDoc', app.docs.all()) | 33 | @html @tmpl('sidebarDoc', app.docs.all()) |
| 34 | unless app.doc or app.settings.hasDocs() | 34 | unless app.isSingleDoc() or app.settings.hasDocs() |
| 35 | @append @tmpl('sidebarDoc', app.disabledDocs.all(), disabled: true) | 35 | @append @tmpl('sidebarDoc', app.disabledDocs.all(), disabled: true) |
| 36 | return | 36 | return |
| 37 | 37 | ||
| @@ -16,7 +16,7 @@ class app.views.Sidebar extends app.View · 15 unmodified lines | |||
| 16 | 16 | ||
| 17 | @results = new app.views.Results @search | 17 | @results = new app.views.Results @search |
| 18 | @docList = new app.views.DocList | 18 | @docList = new app.views.DocList |
| 19 | @docPicker = new app.views.DocPicker unless app.doc | 19 | @docPicker = new app.views.DocPicker unless app.isSingleDoc() |
| 20 | 20 | ||
| 21 | app.on 'ready', @showDocList | 21 | app.on 'ready', @showDocList |
| 22 | $.on document, 'click', @onGlobalClick if @docPicker | 22 | $.on document, 'click', @onGlobalClick if @docPicker |