mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-27 07:48:16 -05:00
Complete the unfinished TabbedPane widget.
This commit is contained in:
@@ -2910,7 +2910,7 @@ class TabbedPane(Templated):
|
||||
for tab_name, title, pane in tabs:
|
||||
buttons.append(JsButton(title, onclick="return select_tab_menu(this, '%s');" % tab_name))
|
||||
|
||||
self.tabmenu = JsNavMenu(buttons, type = 'tabpane')
|
||||
self.tabmenu = JsNavMenu(buttons, type = 'tabmenu')
|
||||
self.tabs = tabs
|
||||
|
||||
Templated.__init__(self)
|
||||
|
||||
@@ -33,6 +33,16 @@ function close_menus(event) {
|
||||
|
||||
function hover_open_menu(menu) { };
|
||||
|
||||
function select_tab_menu(tab_link, tab_name) {
|
||||
var target = "tabbedpane-" + tab_name;
|
||||
var menu = $(tab_link).parent().parent().parent();
|
||||
menu.find(".tabmenu li").removeClass("selected");
|
||||
$(tab_link).parent().addClass("selected");
|
||||
menu.find(".tabbedpane").each(function() {
|
||||
this.style.display = (this.id == target) ? "block" : "none";
|
||||
});
|
||||
}
|
||||
|
||||
function update_user(form) {
|
||||
try {
|
||||
var user = $(form).find('input[name="user"]').val();
|
||||
|
||||
Reference in New Issue
Block a user