Skip to content

Commit f14d739

Browse files
committed
Simplified content tabs implementation
1 parent bac1301 commit f14d739

File tree

5 files changed

+10
-13
lines changed

5 files changed

+10
-13
lines changed

material/assets/javascripts/bundle.195ba817.min.js renamed to material/assets/javascripts/bundle.01d7f443.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

material/assets/javascripts/bundle.195ba817.min.js.map renamed to material/assets/javascripts/bundle.01d7f443.min.js.map

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

material/base.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@
213213
</script>
214214
{% endblock %}
215215
{% block scripts %}
216-
<script src="{{ 'assets/javascripts/bundle.195ba817.min.js' | url }}"></script>
216+
<script src="{{ 'assets/javascripts/bundle.01d7f443.min.js' | url }}"></script>
217217
{% for path in config["extra_javascript"] %}
218218
<script src="{{ path | url }}"></script>
219219
{% endfor %}

src/assets/javascripts/components/content/tabs/index.ts

+3-6
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,12 @@ export function watchContentTabs(
6868
return merge(...getElements(":scope > input", el)
6969
.map(input => fromEvent(input, "change")
7070
.pipe(
71-
mapTo(input.id)
71+
mapTo<ContentTabs>({
72+
active: getElement(`label[for=${input.id}]`)
73+
})
7274
)
7375
)
7476
)
75-
.pipe(
76-
map(id => ({
77-
active: getElement<HTMLLabelElement>(`label[for=${id}]`)
78-
}))
79-
)
8077
}
8178

8279
/**

src/assets/javascripts/components/header/title/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ interface MountOptions {
8585
* @returns Header title observable
8686
*/
8787
export function watchHeaderTitle(
88-
el: HTMLHeadingElement, { viewport$, header$ }: WatchOptions
88+
el: HTMLElement, { viewport$, header$ }: WatchOptions
8989
): Observable<HeaderTitle> {
9090
return watchViewportAt(el, { viewport$, header$ })
9191
.pipe(
@@ -123,7 +123,7 @@ export function mountHeaderTitle(
123123
})
124124

125125
/* Obtain headline, if any */
126-
const heading = getOptionalElement<HTMLHeadingElement>("article h1")
126+
const heading = getOptionalElement("article h1")
127127
if (typeof heading === "undefined")
128128
return EMPTY
129129

0 commit comments

Comments
 (0)