Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

components: Convert .data("tab-id") to .attr.

Anders Kaseorgbc9a7ef27473
diff --git a/web/src/components.ts b/web/src/components.ts
index f17b4d22957..fbaabe2abb0 100644
--- a/web/src/components.ts
+++ b/web/src/components.ts
@@ -116,7 +116,7 @@ export function toggle(opts: {
}
meta.$ind_tab.on("click", function () {
- const idx = $(this).data("tab-id");
+ const idx = Number($(this).attr("data-tab-id"));
select_tab(idx);
});
diff --git a/web/tests/components.test.js b/web/tests/components.test.js
index 650f219d419..47854ed79ab 100644
--- a/web/tests/components.test.js
+++ b/web/tests/components.test.js
@@ -33,8 +33,8 @@ function make_tab(i) {
return tokens.includes(c);
};
- $self.data = (name) => {
- assert.equal(name, "tab-id");
+ $self.attr = (name) => {
+ assert.equal(name, "data-tab-id");
return i;
};