Переглянути джерело

Merge pull request #1044 from Arantor/release-2.1

More fixing for the toggler stuff in general
Arantor 11 роки тому
батько
коміт
b480e58faa

+ 2 - 2
Themes/default/ManageLanguages.template.php

@@ -100,7 +100,7 @@ function template_download_language()
 		echo '
 				<tr class="titlebg">
 					<td colspan="4">
-						<img class="sort" src="', $settings['images_url'], '/sort_down.png" id="toggle_image_', $theme, '" alt="*" />&nbsp;', isset($context['theme_names'][$theme]) ? $context['theme_names'][$theme] : $theme, '
+						<img class="sort" src="', $settings['images_url'], '/selected_open.png" id="toggle_image_', $theme, '" alt="*" />&nbsp;', isset($context['theme_names'][$theme]) ? $context['theme_names'][$theme] : $theme, '
 					</td>
 				</tr>';
 
@@ -216,7 +216,7 @@ function template_download_language()
 				aSwapImages: [
 					{
 						sId: \'toggle_image_', $theme, '\',
-						srcExpanded: smf_images_url + \'/sort_down.png\',
+						srcExpanded: smf_images_url + \'/selected_open.png\',
 						altExpanded: \'*\',
 						srcCollapsed: smf_images_url + \'/selected.png\',
 						altCollapsed: \'*\'

+ 1 - 1
Themes/default/ManageNews.template.php

@@ -51,7 +51,7 @@ function template_email_members()
 			<div id="advanced_panel_header" class="cat_bar">
 				<h3 class="catbg">
 					<span id="advanced_panel_toggle" class="toggle_down floatright" style="display: none;"></span>
-					<a href="#" id="advanced_panel_link" >', $txt['advanced'], '</a>
+					<a href="#" id="advanced_panel_link">', $txt['advanced'], '</a>
 				</h3>
 			</div>
 

+ 1 - 1
Themes/default/PersonalMessage.template.php

@@ -795,7 +795,7 @@ function template_search()
 					</h4>
 				</div>
 				<div id="advanced_panel_div">
-					<ul id="searchLabelsExpand" class="reset" >';
+					<ul id="searchLabelsExpand" class="reset">';
 
 			foreach ($context['search_labels'] as $label)
 				echo '

+ 27 - 8
Themes/default/Search.template.php

@@ -160,15 +160,11 @@ function template_main()
 			<div class="roundframe">
 				<div class="title_bar">
 					<h4 class="titlebg">
-						<span class="floatright">
-							<a href="javascript:void(0);" onclick="expandCollapseBoards(); return false;"><img src="', $settings['images_url'], '/expand.png" id="expandBoardsIcon" alt=""  class="icon"/></a>
-						</span>
-						<span>
-							<a href="javascript:void(0);" onclick="expandCollapseBoards(); return false;"><strong>', $txt['choose_board'], '</strong></a>
-						</span>
+						<span id="advanced_panel_toggle" class="toggle_down floatright" style="display: none;"></span>
+						<a href="#" id="advanced_panel_link">', $txt['choose_board'], '</a>
 					</h4>
 				</div>
-				<div class="flow_auto" id="searchBoardsExpand"', $context['boards_check_all'] ? ' style="display: none;"' : '', '>
+				<div class="flow_auto" id="advanced_panel_div"', $context['boards_check_all'] ? ' style="display: none;"' : '', '>
 					<ul class="ignoreboards floatleft">';
 
 	$i = 0;
@@ -198,7 +194,7 @@ function template_main()
 									</label>
 								</li>';
 
-			$i ++;
+			$i++;
 		}
 
 		echo '
@@ -221,6 +217,29 @@ function template_main()
 		</fieldset>';
 		}
 	echo '
+	<script type="text/javascript"><!-- // --><![CDATA[
+		var oAdvancedPanelToggle = new smc_Toggle({
+			bToggleEnabled: true,
+			bCurrentlyCollapsed: ', $context['boards_check_all'] ? 'true' : 'false', ',
+			aSwappableContainers: [
+				\'advanced_panel_div\'
+			],
+			aSwapImages: [
+				{
+					sId: \'advanced_panel_toggle\',
+					altExpanded: ', JavaScriptEscape($txt['hide']), ',
+					altCollapsed: ', JavaScriptEscape($txt['show']), '
+				}
+			],
+			aSwapLinks: [
+				{
+					sId: \'advanced_panel_link\',
+					msgExpanded: ', JavaScriptEscape($txt['choose_board']), ',
+					msgCollapsed: ', JavaScriptEscape($txt['choose_board']), '
+				}
+			]
+		});
+	// ]]></script>
 		<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/suggest.js?alp21"></script>
 		<script type="text/javascript"><!-- // --><![CDATA[
 			var oAddMemberSuggest = new smc_AutoSuggest({

+ 0 - 6
Themes/default/css/rtl.css

@@ -792,12 +792,6 @@ tr.windowbg2 th.stats_month, tr.windowbg2 td.stats_day {
 	text-align: right;
 }
 /* Boards picker */
-#searchform fieldset div#searchBoardsExpand ul {
-	margin: 0 1em 0 0;
-}
-#searchform fieldset div#searchBoardsExpand li {
-	float: right;
-}
 #searchform fieldset p {
 	text-align: right;
 }

BIN
Themes/default/images/sort_down.png


BIN
Themes/default/images/sort_up.png


+ 0 - 16
Themes/default/scripts/script.js

@@ -1626,22 +1626,6 @@ function selectBoards(ids, aFormID)
 		aForm["brd" + ids[i]].checked = !toggle;
 }
 
-function expandCollapseBoards()
-{
-	var current = document.getElementById("searchBoardsExpand").style.display != "none";
-
-	$("#searchBoardsExpand").slideToggle(300);
-	document.getElementById("expandBoardsIcon").src = smf_images_url + (current ? "/expand.png" : "/collapse.png");
-}
-
-function expandCollapseLabels()
-{
-	var current = document.getElementById("searchLabelsExpand").style.display != "none";
-
-	$("#searchLabelsExpand").slideToggle();
-	document.getElementById("expandLabelsIcon").src = smf_images_url + (current ? "/expand.png" : "/collapse.png");
-}
-
 function updateRuleDef(optNum)
 {
 	if (document.getElementById("ruletype" + optNum).value == "gid")