History

Fix merge conflicts

Jasper van Merle committed 7 years ago

Commit 54381432 parents 4355631 ac50e9943 files · +760 −254Browse files

Showing the changes to assets/javascripts (18 of 43 files). Show all

Unified · Split

18 files
  1. assets/javascripts/app/app.coffee +9 −7
  2. assets/javascripts/app/appcache.coffee +0 −42
  3. assets/javascripts/app/config.coffee.erb +2 −0
  4. assets/javascripts/app/serviceworker.coffee +49 −0
  5. assets/javascripts/app/settings.coffee +30 −0
  6. assets/javascripts/app/update_checker.coffee +3 −3
  7. assets/javascripts/lib/util.coffee +4 −0
  8. assets/javascripts/news.json +4 −0
  9. assets/javascripts/templates/error_tmpl.coffee +5 −5
  10. assets/javascripts/templates/pages/offline_tmpl.coffee +9 −4
  11. assets/javascripts/templates/pages/root_tmpl.coffee.erb +2 −2
  12. assets/javascripts/views/content/entry_page.coffee +1 −1
  13. assets/javascripts/views/content/settings_page.coffee +1 −11
  14. assets/javascripts/views/layout/resizer.coffee +2 −9
  15. assets/javascripts/views/layout/settings.coffee +1 −9
  16. assets/javascripts/views/search/search.coffee +8 −0
  17. assets/javascripts/views/search/search_scope.coffee +23 −5
  18. assets/javascripts/views/sidebar/sidebar.coffee +1 −1
assets/javascripts/app/app.coffee+9−7
@@ -13,10 +13,12 @@ · 12 unmodified lines
1313
1414 @el = $('._app')
1515 @localStorage = new LocalStorageStore
16− @appCache = new app.AppCache if app.AppCache.isEnabled()
16+ @serviceWorker = new app.ServiceWorker if app.ServiceWorker.isEnabled()
1717 @settings = new app.Settings
1818 @db = new app.DB()
1919
20+ @settings.initLayout()
21+
2022 @docs = new app.collections.Docs
2123 @disabledDocs = new app.collections.Docs
2224 @entries = new app.collections.Entries
@@ -147,7 +149,7 @@ · 124 unmodified lines
147149 saveDocs: ->
148150 @settings.setDocs(doc.slug for doc in @docs.all())
149151 @db.migrate()
150− @appCache?.updateInBackground()
152+ @serviceWorker?.updateInBackground()
151153
152154 welcomeBack: ->
153155 visitCount = @settings.get('count')
@@ -167,14 +169,14 @@ · 13 unmodified lines
167169 reload: ->
168170 @docs.clearCache()
169171 @disabledDocs.clearCache()
170− if @appCache then @appCache.reload() else @reboot()
172+ if @serviceWorker then @serviceWorker.reload() else @reboot()
171173 return
172174
173175 reset: ->
174176 @localStorage.reset()
175177 @settings.reset()
176178 @db?.reset()
177− @appCache?.update()
179+ @serviceWorker?.update()
178180 window.location = '/'
179181 return
180182
@@ -193,9 +195,9 @@ · 12 unmodified lines
193195 return
194196
195197 indexHost: ->
196− # Can't load the index files from the host/CDN when applicationCache is
198+ # Can't load the index files from the host/CDN when service worker is
197199 # enabled because it doesn't support caching URLs that use CORS.
198− @config[if @appCache and @settings.hasDocs() then 'index_path' else 'docs_origin']
200+ @config[if @serviceWorker and @settings.hasDocs() then 'index_path' else 'docs_origin']
199201
200202 onBootError: (args...) ->
201203 @trigger 'bootError'
@@ -252,7 +254,7 @@ · 50 unmodified lines
252254 matchMedia: !!window.matchMedia
253255 insertAdjacentHTML: !!document.body.insertAdjacentHTML
254256 defaultPrevented: document.createEvent('CustomEvent').defaultPrevented is false
255− cssVariables: CSS.supports and CSS.supports('(--t: 0)')
257+ cssVariables: !!CSS?.supports?('(--t: 0)')
256258
257259 for key, value of features when not value
258260 Raven.captureMessage "unsupported/#{key}", level: 'info'
assets/javascripts/app/appcache.coffee+0−42
@@ -1,42 +0,0 @@
1−class app.AppCache
2− $.extend @prototype, Events
3−
4− @isEnabled: ->
5− try
6− applicationCache and applicationCache.status isnt applicationCache.UNCACHED
7− catch
8−
9− constructor: ->
10− @cache = applicationCache
11− @notifyUpdate = true
12− @onUpdateReady() if @cache.status is @cache.UPDATEREADY
13−
14− $.on @cache, 'progress', @onProgress
15− $.on @cache, 'updateready', @onUpdateReady
16−
17− update: ->
18− @notifyUpdate = true
19− @notifyProgress = true
20− try @cache.update() catch
21− return
22−
23− updateInBackground: ->
24− @notifyUpdate = false
25− @notifyProgress = false
26− try @cache.update() catch
27− return
28−
29− reload: ->
30− $.on @cache, 'updateready noupdate error', -> app.reboot()
31− @notifyUpdate = false
32− @notifyProgress = true
33− try @cache.update() catch
34− return
35−
36− onProgress: (event) =>
37− @trigger 'progress', event if @notifyProgress
38− return
39−
40− onUpdateReady: =>
41− @trigger 'updateready' if @notifyUpdate
42− return
assets/javascripts/app/config.coffee.erb+2−0
@@ -13,3 +13,5 @@ app.config = · 12 unmodified lines
1313 version: <%= Time.now.to_i %>
1414 release: <%= Time.now.utc.httpdate.to_json %>
1515 mathml_stylesheet: '<%= App.cdn_origin %>/mathml.css'
16+ service_worker_path: '/service-worker.js'
17+ service_worker_enabled: <%= App.environment == :production || ENV['ENABLE_SERVICE_WORKER'] == 'true' %>
assets/javascripts/app/serviceworker.coffee+49−0
@@ -0,0 +1,49 @@
1+class app.ServiceWorker
2+ $.extend @prototype, Events
3+
4+ @isEnabled: ->
5+ !!navigator.serviceWorker and app.config.service_worker_enabled
6+
7+ constructor: ->
8+ @registration = null
9+ @notifyUpdate = true
10+
11+ navigator.serviceWorker.register(app.config.service_worker_path, {scope: '/'})
12+ .then(
13+ (registration) => @updateRegistration(registration),
14+ (error) -> console.error('Could not register service worker:', error)
15+ )
16+
17+ update: ->
18+ return unless @registration
19+ @notifyUpdate = true
20+ return @registration.update().catch(->)
21+
22+ updateInBackground: ->
23+ return unless @registration
24+ @notifyUpdate = false
25+ return @registration.update().catch(->)
26+
27+ reload: ->
28+ return @updateInBackground().then(() -> app.reboot())
29+
30+ updateRegistration: (registration) ->
31+ @registration = registration
32+ $.on @registration, 'updatefound', @onUpdateFound
33+ return
34+
35+ onUpdateFound: =>
36+ $.off @installingRegistration, 'statechange', @onStateChange() if @installingRegistration
37+ @installingRegistration = @registration.installing
38+ $.on @installingRegistration, 'statechange', @onStateChange
39+ return
40+
41+ onStateChange: =>
42+ if @installingRegistration and @installingRegistration.state == 'installed' and navigator.serviceWorker.controller
43+ @installingRegistration = null
44+ @onUpdateReady()
45+ return
46+
47+ onUpdateReady: ->
48+ @trigger 'updateready' if @notifyUpdate
49+ return
assets/javascripts/app/settings.coffee+30−0
@@ -20,6 +20,8 @@ class app.Settings · 19 unmodified lines
2020 'news'
2121 ]
2222
23+ LAYOUTS: ['_max-width', '_sidebar-hidden', '_native-scrollbars']
24+
2325 @defaults:
2426 count: 0
2527 hideDisabled: false
@@ -40,6 +42,7 @@ class app.Settings · 14 unmodified lines
4042 set: (key, value) ->
4143 @store.set(key, value)
4244 delete @cache[key]
45+ @toggleDark(value) if key == 'dark'
4346 return
4447
4548 del: (key) ->
@@ -65,6 +68,8 @@ class app.Settings · 19 unmodified lines
6568 return
6669
6770 setLayout: (name, enable) ->
71+ @toggleLayout(name, enable)
72+
6873 layout = (@store.get('layout') || '').split(' ')
6974 $.arrayDelete(layout, '')
7075
@@ -106,3 +111,28 @@ class app.Settings · 35 unmodified lines
106111 @store.reset()
107112 @cache = {}
108113 return
114+
115+ initLayout: ->
116+ @toggleDark(@get('dark') is 1)
117+ @toggleLayout(layout, @hasLayout(layout)) for layout in @LAYOUTS
118+ @initSidebarWidth()
119+ return
120+
121+ toggleDark: (enable) ->
122+ classList = document.documentElement.classList
123+ classList.toggle('_theme-default', !enable)
124+ classList.toggle('_theme-dark', enable)
125+ color = getComputedStyle(document.documentElement).getPropertyValue('--headerBackground').trim()
126+ $('meta[name=theme-color]').setAttribute('content', color)
127+ return
128+
129+ toggleLayout: (layout, enable) ->
130+ classList = document.body.classList
131+ classList.toggle(layout, enable) unless layout is '_sidebar-hidden'
132+ classList.toggle('_overlay-scrollbars', $.overlayScrollbarsEnabled())
133+ return
134+
135+ initSidebarWidth: ->
136+ size = @get('size')
137+ document.documentElement.style.setProperty('--sidebarWidth', size + 'px') if size
138+ return
assets/javascripts/app/update_checker.coffee+3−3
@@ -3,13 +3,13 @@ class app.UpdateChecker · 2 unmodified lines
33 @lastCheck = Date.now()
44
55 $.on window, 'focus', @onFocus
6− app.appCache.on 'updateready', @onUpdateReady if app.appCache
6+ app.serviceWorker?.on 'updateready', @onUpdateReady
77
88 setTimeout @checkDocs, 0
99
1010 check: ->
11− if app.appCache
12− app.appCache.update()
11+ if app.serviceWorker
12+ app.serviceWorker.update()
1313 else
1414 ajax
1515 url: $('script[src*="application"]').getAttribute('src')
assets/javascripts/lib/util.coffee+4−0
@@ -352,6 +352,10 @@ isIE = null · 351 unmodified lines
352352 $.isIE = ->
353353 isIE ?= navigator.userAgent?.indexOf('MSIE') >= 0 || navigator.userAgent?.indexOf('rv:11.0') >= 0
354354
355+isChromeForAndroid = null
356+$.isChromeForAndroid = ->
357+ isChromeForAndroid ?= navigator.userAgent?.indexOf('Android') >= 0 && /Chrome\/([.0-9])+ Mobile/.test(navigator.userAgent)
358+
355359 isAndroid = null
356360 $.isAndroid = ->
357361 isAndroid ?= navigator.userAgent?.indexOf('Android') >= 0
assets/javascripts/news.json+4−0
@@ -1,4 +1,8 @@
11 [
2+ [
3+ "2019-07-19",
4+ "Replaced the AppCache with a Service Worker (which makes DevDocs an installable PWA) and fixed layout preferences on Firefox."
5+ ],
26 [
37 "2018-09-23",
48 "New documentations: <a href=\"/puppeteer/\">Puppeteer</a> and <a href=\"/handlebars/\">Handlebars.js</a>"
assets/javascripts/templates/error_tmpl.coffee+5−5
@@ -12,8 +12,8 @@ app.templates.notFoundPage = -> · 11 unmodified lines
1212
1313 app.templates.pageLoadError = ->
1414 error """ The page failed to load. """,
15− """ It may be missing from the server (try reloading the app) or you could be offline.<br>
16− If you keep seeing this, you're likely behind a proxy or firewall that blocks cross-domain requests. """,
15+ """ It may be missing from the server (try reloading the app) or you could be offline (try <a href="/offline">installing the documentation for offline usage</a> when online again).<br>
16+ If you're online and you keep seeing this, you're likely behind a proxy or firewall that blocks cross-domain requests. """,
1717 """ #{back} &middot; <a href="/##{location.pathname}" target="_top" class="_error-link">Reload</a>
1818 &middot; <a href="#" class="_error-link" data-retry>Retry</a> """
1919
@@ -57,9 +57,9 @@ app.templates.unsupportedBrowser = """ · 37 unmodified lines
5757 <p class="_fail-text">DevDocs is an API documentation browser which supports the following browsers:
5858 <ul class="_fail-list">
5959 <li>Recent versions of Firefox, Chrome, or Opera
60− <li>Safari 9.1+
61− <li>Edge 16+
62− <li>iOS 10+
60+ <li>Safari 11.1+
61+ <li>Edge 17+
62+ <li>iOS 11.3+
6363 </ul>
6464 <p class="_fail-text">
6565 If you're unable to upgrade, we apologize.
assets/javascripts/templates/pages/offline_tmpl.coffee+9−4
@@ -25,8 +25,8 @@ app.templates.offlinePage = (docs) -> """ · 24 unmodified lines
2525 <h2 class="_block-heading">Questions & Answers</h2>
2626 <dl>
2727 <dt>How does this work?
28− <dd>Each page is cached as a key-value pair in <a href="https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API">IndexedDB</a> (downloaded from a single file).<br>
29− The app also uses <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Using_the_application_cache">AppCache</a> and <a href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API">localStorage</a> to cache the assets and index files.
28+ <dd>Each page is cached as a key-value pair in <a href="https://devdocs.io/dom/indexeddb_api">IndexedDB</a> (downloaded from a single file).<br>
29+ The app also uses <a href="https://devdocs.io/dom/service_worker_api/using_service_workers">Service Workers</a> and <a href="https://devdocs.io/dom/web_storage_api">localStorage</a> to cache the assets and index files.
3030 <dt>Can I close the tab/browser?
3131 <dd>#{canICloseTheTab()}
3232 <dt>What if I don't update a documentation?
@@ -41,10 +41,15 @@ app.templates.offlinePage = (docs) -> """ · 8 unmodified lines
4141 """
4242
4343 canICloseTheTab = ->
44− if app.AppCache.isEnabled()
44+ if app.ServiceWorker.isEnabled()
4545 """ Yes! Even offline, you can open a new tab, go to <a href="//devdocs.io">devdocs.io</a>, and everything will work as if you were online (provided you installed all the documentations you want to use beforehand). """
4646 else
47− """ No. AppCache isn't available in your browser (or is disabled), so loading <a href="//devdocs.io">devdocs.io</a> offline won't work.<br>
47+ reason = "aren't available in your browser (or are disabled)"
48+
49+ if app.config.env != 'production'
50+ reason = "are disabled in your development instance of DevDocs (enable them by setting the <code>ENABLE_SERVICE_WORKER</code> environment variable to <code>true</code>)"
51+
52+ """ No. Service Workers #{reason}, so loading <a href="//devdocs.io">devdocs.io</a> offline won't work.<br>
4853 The current tab will continue to function even when you go offline (provided you installed all the documentations beforehand). """
4954
5055 app.templates.offlineDoc = (doc, status) ->
assets/javascripts/templates/pages/root_tmpl.coffee.erb+2−2
@@ -8,7 +8,7 @@ app.templates.intro = """ · 7 unmodified lines
88 <p>Thanks for downloading DevDocs. Here are a few things you should know:
99 <ol class="_intro-list">
1010 <li>Your local version of DevDocs won't self-update. Unless you're modifying the code,
11− I&nbsp;recommend using the hosted version at <a href="https://devdocs.io">devdocs.io</a>.
11+ we&nbsp;recommend using the hosted version at <a href="https://devdocs.io">devdocs.io</a>.
1212 <li>Run <code>thor docs:list</code> to see all available documentations.
1313 <li>Run <code>thor docs:download &lt;name&gt;</code> to download documentations.
1414 <li>Run <code>thor docs:download --installed</code> to update all downloaded documentations.
@@ -39,7 +39,7 @@ app.templates.intro = """ · 24 unmodified lines
3939 <li>DevDocs works <a href="/offline">offline</a>, on mobile, and can be installed on <a href="https://chrome.google.com/webstore/detail/devdocs/mnfehgbmkapmjnhcnbodoamcioleeooe">Chrome</a>.
4040 <li>For the latest news, follow <a href="https://twitter.com/DevDocs">@DevDocs</a>.
4141 <li>DevDocs is free and <a href="https://github.com/freeCodeCamp/devdocs">open source</a>.
42− <iframe class="_github-btn" src="//ghbtns.com/github-btn.html?user=freeCodeCamp&repo=devdocs&type=watch&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="100" height="20"></iframe>
42+ <object data="https://img.shields.io/github/stars/freeCodeCamp/devdocs.svg?style=social" type="image/svg+xml" aria-hidden="true"></object>
4343 <li>And if you're new to coding, check out <a href="https://www.freecodecamp.org/">freeCodeCamp's open source curriculum</a>.
4444 </ol>
4545 <p>Happy coding!
assets/javascripts/views/content/entry_page.coffee+1−1
@@ -123,7 +123,7 @@ class app.views.EntryPage extends app.View · 122 unmodified lines
123123 @render @tmpl('pageLoadError')
124124 @resetClass()
125125 @addClass @constructor.errorClass
126− app.appCache?.update()
126+ app.serviceWorker?.update()
127127 return
128128
129129 cache: ->
assets/javascripts/views/content/settings_page.coffee+1−11
@@ -1,7 +1,4 @@
11 class app.views.SettingsPage extends app.View
2− LAYOUTS = ['_max-width', '_sidebar-hidden', '_native-scrollbars']
3− SIDEBAR_HIDDEN_LAYOUT = '_sidebar-hidden'
4−
52 @className: '_static'
63
74 @events:
@@ -18,25 +15,18 @@ class app.views.SettingsPage extends app.View · 10 unmodified lines
1815 settings.smoothScroll = !app.settings.get('fastScroll')
1916 settings.arrowScroll = app.settings.get('arrowScroll')
2017 settings.analyticsConsent = app.settings.get('analyticsConsent')
21− settings[layout] = app.settings.hasLayout(layout) for layout in LAYOUTS
18+ settings[layout] = app.settings.hasLayout(layout) for layout in app.settings.LAYOUTS
2219 settings
2320
2421 getTitle: ->
2522 'Preferences'
2623
2724 toggleDark: (enable) ->
28− html = document.documentElement
29− html.classList.toggle('_theme-default')
30− html.classList.toggle('_theme-dark')
3125 app.settings.set('dark', !!enable)
32− app.appCache?.updateInBackground()
3326 return
3427
3528 toggleLayout: (layout, enable) ->
36− document.body.classList[if enable then 'add' else 'remove'](layout) unless layout is SIDEBAR_HIDDEN_LAYOUT
37− document.body.classList[if $.overlayScrollbarsEnabled() then 'add' else 'remove']('_overlay-scrollbars')
3829 app.settings.setLayout(layout, enable)
39− app.appCache?.updateInBackground()
4030 return
4131
4232 toggleSmoothScroll: (enable) ->
assets/javascripts/views/layout/resizer.coffee+2−9
@@ -11,9 +11,6 @@ class app.views.Resizer extends app.View · 10 unmodified lines
1111 init: ->
1212 @el.setAttribute('draggable', 'true')
1313 @appendTo $('._app')
14−
15− @style = $('style[data-resizer]')
16− @size = @style.getAttribute('data-size')
1714 return
1815
1916 MIN = 260
@@ -24,15 +21,11 @@ class app.views.Resizer extends app.View · 4 unmodified lines
2421 return unless value > 0
2522 value = Math.min(Math.max(Math.round(value), MIN), MAX)
2623 newSize = "#{value}px"
27− @style.innerHTML = @style.innerHTML.replace(new RegExp(@size, 'g'), newSize)
28− @size = newSize
29− if save
30− app.settings.setSize(value)
31− app.appCache?.updateInBackground()
24+ document.documentElement.style.setProperty('--sidebarWidth', newSize)
25+ app.settings.setSize(value) if save
3226 return
3327
3428 onDragStart: (event) =>
35− @style.removeAttribute('disabled')
3629 event.dataTransfer.effectAllowed = 'link'
3730 event.dataTransfer.setData('Text', '')
3831 $.on(window, 'dragover', @onDrag)
assets/javascripts/views/layout/settings.coffee+1−9
@@ -25,7 +25,6 @@ class app.views.Settings extends app.View · 24 unmodified lines
2525 if super
2626 @render()
2727 document.body.classList.remove(SIDEBAR_HIDDEN_LAYOUT)
28− app.appCache?.on 'progress', @onAppCacheProgress
2928 return
3029
3130 deactivate: ->
@@ -33,7 +32,6 @@ class app.views.Settings extends app.View · 1 unmodified line
3332 @resetClass()
3433 @docPicker.detach()
3534 document.body.classList.add(SIDEBAR_HIDDEN_LAYOUT) if app.settings.hasLayout(SIDEBAR_HIDDEN_LAYOUT)
36− app.appCache?.off 'progress', @onAppCacheProgress
3735 return
3836
3937 render: ->
@@ -52,7 +50,7 @@ class app.views.Settings extends app.View · 12 unmodified lines
5250 docs = @docPicker.getSelectedDocs()
5351 app.settings.setDocs(docs)
5452
55− @saveBtn.textContent = if app.appCache then 'Downloading\u2026' else 'Saving\u2026'
53+ @saveBtn.textContent = 'Saving\u2026'
5654 disabledDocs = new app.collections.Docs(doc for doc in app.docs.all() when docs.indexOf(doc.slug) is -1)
5755 disabledDocs.uninstall ->
5856 app.db.migrate()
@@ -83,9 +81,3 @@ class app.views.Settings extends app.View · 24 unmodified lines
8381 $.stopEvent(event)
8482 app.router.show '/'
8583 return
86−
87− onAppCacheProgress: (event) =>
88− if event.lengthComputable
89− percentage = Math.round event.loaded * 100 / event.total
90− @saveBtn.textContent = "Downloading\u2026 (#{percentage}%)"
91− return
assets/javascripts/views/search/search.coffee+8−0
@@ -30,6 +30,9 @@ class app.views.Search extends app.View · 29 unmodified lines
3030 .on 'results', @onResults
3131 .on 'end', @onEnd
3232
33+ @scope
34+ .on 'change', @onScopeChange
35+
3336 app.on 'ready', @onReady
3437 $.on window, 'hashchange', @searchUrl
3538 $.on window, 'focus', @onWindowFocus
@@ -138,6 +141,11 @@ class app.views.Search extends app.View · 102 unmodified lines
138141 $.stopEvent(event)
139142 return
140143
144+ onScopeChange: =>
145+ @value = ''
146+ @onInput()
147+ return
148+
141149 afterRoute: (name, context) =>
142150 return if app.shortcuts.eventInProgress?.name is 'escape'
143151 @reset(true) if not context.init and app.router.isIndex()
assets/javascripts/views/search/search_scope.coffee+23−5
@@ -6,7 +6,9 @@ class app.views.SearchScope extends app.View · 5 unmodified lines
66 tag: '._search-tag'
77
88 @events:
9+ click: 'onClick'
910 keydown: 'onKeydown'
11+ textInput: 'onTextInput'
1012
1113 @routes:
1214 after: 'afterRoute'
@@ -87,17 +89,33 @@ class app.views.SearchScope extends app.View · 74 unmodified lines
8789 @trigger 'change', null, previousDoc
8890 return
8991
92+ doScopeSearch: (event) =>
93+ @search @input.value[0...@input.selectionStart]
94+ $.stopEvent(event) if @doc
95+ return
96+
97+ onClick: (event) =>
98+ if event.target is @tag
99+ @reset()
100+ $.stopEvent(event)
101+ return
102+
90103 onKeydown: (event) =>
91104 if event.which is 8 # backspace
92− if @doc and not @input.value
93− $.stopEvent(event)
105+ if @doc and @input.selectionEnd is 0
94106 @reset()
95− else if not @doc and @input.value
107+ $.stopEvent(event)
108+ else if not @doc and @input.value and not $.isChromeForAndroid()
96109 return if event.ctrlKey or event.metaKey or event.altKey or event.shiftKey
97110 if event.which is 9 or # tab
98111 (event.which is 32 and app.isMobile()) # space
99− @search @input.value[0...@input.selectionStart]
100− $.stopEvent(event) if @doc
112+ @doScopeSearch(event)
113+ return
114+
115+ onTextInput: (event) =>
116+ return unless $.isChromeForAndroid()
117+ if not @doc and @input.value and event.data == ' '
118+ @doScopeSearch(event)
101119 return
102120
103121 extractHashValue: ->
assets/javascripts/views/sidebar/sidebar.coffee+1−1
@@ -28,7 +28,7 @@ class app.views.Sidebar extends app.View · 27 unmodified lines
2828
2929 app.on 'ready', @onReady
3030
31− $.on document.documentElement, 'mouseleave', (event) => @display() if event.clientX < 10
31+ $.on document.documentElement, 'mouseleave', (event) => @display() unless event.clientX <= 0
3232 $.on document.documentElement, 'mouseenter', => @resetDisplay(forceNoHover: false)
3333 return
3434