Merge branch 'develop-ascraeus' into develop

* develop-ascraeus:
  [ticket/12640] Preserve the active tab when previewing in posting page.
This commit is contained in:
Marc Alexander 2014-06-04 23:26:22 +02:00
commit b46e68c65d
4 changed files with 4 additions and 1 deletions

View file

@ -1546,6 +1546,7 @@ $page_data = array(
'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '', 'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
'TOPIC_TIME_LIMIT' => (int) $post_data['topic_time_limit'], 'TOPIC_TIME_LIMIT' => (int) $post_data['topic_time_limit'],
'EDIT_REASON' => $request->variable('edit_reason', ''), 'EDIT_REASON' => $request->variable('edit_reason', ''),
'SHOW_PANEL' => $request->variable('show_panel', ''),
'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id"), 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id"),
'U_VIEW_TOPIC' => ($mode != 'post') ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id") : '', 'U_VIEW_TOPIC' => ($mode != 'post') ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id") : '',
'U_PROGRESS_BAR' => append_sid("{$phpbb_root_path}posting.$phpEx", "f=$forum_id&amp;mode=popup"), 'U_PROGRESS_BAR' => append_sid("{$phpbb_root_path}posting.$phpEx", "f=$forum_id&amp;mode=popup"),

View file

@ -117,6 +117,7 @@ jQuery(document).ready(function() {
if (typeof(p) === 'string') { if (typeof(p) === 'string') {
show_panel = p; show_panel = p;
} }
$('input[name="show_panel"]').val(show_panel);
for (i = 0; i < panels.length; i++) { for (i = 0; i < panels.length; i++) {
jQuery('#' + panels[i]).css('display', panels[i] === show_panel ? 'block' : 'none'); jQuery('#' + panels[i]).css('display', panels[i] === show_panel ? 'block' : 'none');

View file

@ -99,7 +99,7 @@
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF not S_PRIVMSGS and not S_SHOW_DRAFTS and not $SIG_EDIT eq 1 --> <!-- IF not S_PRIVMSGS and not S_SHOW_DRAFTS and not $SIG_EDIT eq 1 -->
<div id="tabs" class="sub-panels" data-show-panel="options-panel"> <div id="tabs" class="sub-panels" data-show-panel="<!-- IF SHOW_PANEL -->{SHOW_PANEL}<!-- ELSE -->options-panel<!-- ENDIF -->">
<ul> <ul>
<li id="options-panel-tab" class="activetab"><a href="#tabs" data-subpanel="options-panel"><span>{L_OPTIONS}</span></a></li> <li id="options-panel-tab" class="activetab"><a href="#tabs" data-subpanel="options-panel"><span>{L_OPTIONS}</span></a></li>
<!-- IF S_SHOW_ATTACH_BOX --> <!-- IF S_SHOW_ATTACH_BOX -->

View file

@ -68,6 +68,7 @@
<!-- DEFINE $EXTRA_POSTING_OPTIONS = 1 --> <!-- DEFINE $EXTRA_POSTING_OPTIONS = 1 -->
<!-- INCLUDE posting_editor.html --> <!-- INCLUDE posting_editor.html -->
<input type="hidden" name="show_panel" value="options-panel" />
{S_FORM_TOKEN} {S_FORM_TOKEN}
</div> </div>
</div> </div>