forked from zulip/zulip
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stream_edit: Extract toggler to new stream_edit_toggler module.
Signed-off-by: Anders Kaseorg <[email protected]>
- Loading branch information
Showing
4 changed files
with
38 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import $ from "jquery"; | ||
|
||
import * as components from "./components"; | ||
import {$t} from "./i18n"; | ||
|
||
export let toggler; | ||
export let select_tab = "personal_settings"; | ||
|
||
export function setup_toggler() { | ||
toggler = components.toggle({ | ||
child_wants_focus: true, | ||
values: [ | ||
{label: $t({defaultMessage: "General"}), key: "general_settings"}, | ||
{label: $t({defaultMessage: "Personal"}), key: "personal_settings"}, | ||
{label: $t({defaultMessage: "Subscribers"}), key: "subscriber_settings"}, | ||
], | ||
callback(_name, key) { | ||
$(".stream_section").hide(); | ||
$(`.${CSS.escape(key)}`).show(); | ||
select_tab = key; | ||
}, | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters