Skip to content

Commit b09e334

Browse files
committed
Fix requirement for Math.sign
1 parent f71359c commit b09e334

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

material/assets/javascripts/application-eb5283d5b7.js renamed to material/assets/javascripts/application-2afe21e0b2.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

material/base.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
{% else %}
2020
<link rel="shortcut icon" href="{{ base_url }}/assets/images/favicon.ico">
2121
{% endif %}
22-
<meta name="generator" content="mkdocs+mkdocs-material#1.0.2">
22+
<meta name="generator" content="mkdocs+mkdocs-material#1.0.3">
2323
{% endblock %}
2424
{% block htmltitle %}
2525
{% if page.title %}
@@ -124,7 +124,7 @@ <h1>{{ page.title | default(config.site_name, true)}}</h1>
124124
{% endblock %}
125125
</div>
126126
{% block scripts %}
127-
<script src="{{ base_url }}/assets/javascripts/application-eb5283d5b7.js"></script>
127+
<script src="{{ base_url }}/assets/javascripts/application-2afe21e0b2.js"></script>
128128
<script>var config={url:{base:"{{ base_url }}"}},app=new Application(config);app.initialize()</script>
129129
{% for path in extra_javascript %}
130130
<script src="{{ path }}"></script>

src/assets/javascripts/components/Material/Nav/Blur.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export default class Blur {
4242
this.offset_ = window.pageYOffset
4343

4444
/* Necessary state to correctly reset the index */
45-
this.dir_ = 0
45+
this.dir_ = false
4646

4747
/* Index anchor node offsets for fast lookup */
4848
this.anchors_ = [].map.call(this.els_, el => {
@@ -65,12 +65,12 @@ export default class Blur {
6565
*/
6666
update() {
6767
const offset = window.pageYOffset
68-
const dir = Math.sign(this.offset_ - offset)
68+
const dir = this.offset_ - offset < 0
6969

7070
/* Hack: reset index if direction changed, to catch very fast scrolling,
7171
because otherwise we would have to register a timer and that sucks */
7272
if (this.dir_ !== dir)
73-
this.index_ = dir < 0
73+
this.index_ = dir
7474
? this.index_ = 0
7575
: this.index_ = this.els_.length - 1
7676

0 commit comments

Comments
 (0)