Input form switcher works
This change adds the input form switcher, which adds a navigation menu across the top of the input form, letting you switch between different kinds of input. The input menu doesn't yet look like a nice set of tabs; it could use some love.
This commit is contained in:
parent
7aa55f8200
commit
cf1a4d8292
|
@ -1272,6 +1272,15 @@ var SN = { // StatusNet
|
|||
// UI links currently on the page use malleable names.
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
switchInputFormTab: function(tag) {
|
||||
// The one that's current isn't current anymore
|
||||
$('.input_form_nav_tab.current').removeClass('current');
|
||||
$('#input_form_nav_'+tag).addClass('current');
|
||||
|
||||
$('.input_form.current').removeClass('current');
|
||||
$('#input_form_'+tag).addClass('current');
|
||||
}
|
||||
},
|
||||
|
||||
|
|
2
js/util.min.js
vendored
2
js/util.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -657,7 +657,8 @@ class Action extends HTMLOutputter // lawsuit
|
|||
|
||||
foreach ($tabs as $tag => $title) {
|
||||
|
||||
$attrs = array('id' => 'input_form_nav_'.$title);
|
||||
$attrs = array('id' => 'input_form_nav_'.$tag,
|
||||
'class' => 'input_form_nav_tab');
|
||||
|
||||
if ($tag == 'status') {
|
||||
$attrs['class'] = 'current';
|
||||
|
@ -666,7 +667,7 @@ class Action extends HTMLOutputter // lawsuit
|
|||
$this->elementStart('li', $attrs);
|
||||
|
||||
$this->element('a',
|
||||
array('href' => 'javascript:switchInputFormTab("'.$tag.'")'),
|
||||
array('href' => 'javascript:SN.U.switchInputFormTab("'.$tag.'")'),
|
||||
$title);
|
||||
$this->elementEnd('li');
|
||||
}
|
||||
|
@ -679,9 +680,7 @@ class Action extends HTMLOutputter // lawsuit
|
|||
'id' => 'input_form_'.$tag);
|
||||
|
||||
if ($tag == 'status') {
|
||||
$attrs['class'] .= ' active';
|
||||
} else {
|
||||
$attrs['class'] .= ' inactive';
|
||||
$attrs['class'] .= ' current';
|
||||
}
|
||||
|
||||
$this->elementStart('div', $attrs);
|
||||
|
@ -698,6 +697,8 @@ class Action extends HTMLOutputter // lawsuit
|
|||
if (!empty($form)) {
|
||||
$form->show();
|
||||
}
|
||||
|
||||
$this->elementEnd('div');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1953,8 +1953,27 @@ margin-bottom:18px;
|
|||
padding-left:20px;
|
||||
}
|
||||
|
||||
#input_form_nav {
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
}/*end of @media screen, projection, tv*/
|
||||
#input_form_nav li {
|
||||
display:inline;
|
||||
}
|
||||
|
||||
.input_form_nav_tab.current {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.input_form {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.input_form.current {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/*end of @media screen, projection, tv*/
|
||||
|
||||
|
||||
@media print {
|
||||
|
|
Loading…
Reference in New Issue
Block a user