Przeglądaj źródła

! Make expandPages() nest properly: Fixes #669

Signed-off-by: John Rayes <[email protected]>
John Rayes 11 lat temu
rodzic
commit
6c1974e012

+ 1 - 1
Sources/Subs.php

@@ -559,7 +559,7 @@ function constructPageIndex($base_url, &$start, $max_value, $num_per_page, $flex
 
 		// Show the ... after the first page.  (prev page 1 >...< 6 7 [8] 9 10 ... 15 next page)
 		if ($start > $num_per_page * ($PageContiguous + 1))
-			$pageindex .= '<span class="expand_pages" onclick="' . htmlspecialchars('expandPages(this, ' . JavaScriptEscape(($flexible_start ? $base_url : strtr($base_url, array('%' => '%%')) . ';start=%1$d')) . ', ' . $num_per_page . ', ' . ($start - $num_per_page * $PageContiguous) . ', ' . $num_per_page . ');') . '" onmouseover="this.style.cursor = \'pointer\';"><strong> ... </strong></span>';
+			$pageindex .= '<span class="expand_pages" onclick="' . htmlspecialchars('expandPages(this, ' . JavaScriptEscape(($flexible_start ? $base_url : strtr($base_url, array('%' => '%%')) . ';start=%1$d')) . ', ' . $num_per_page . ', ' . ($start - $num_per_page * $PageContiguous) . ', ' . $num_per_page . ');') . '"><strong> ... </strong></span>';
 
 		// Show the pages before the current one. (prev page 1 ... >6 7< [8] 9 10 ... 15 next page)
 		for ($nCont = $PageContiguous; $nCont >= 1; $nCont--)

+ 4 - 0
Themes/default/css/index.css

@@ -544,6 +544,10 @@ div.pagesection div.floatright input, div.pagesection div.floatright select {
 .navPages {
 	padding: 0 1px;
 }
+.expand_pages {
+	font-weight: bold;
+	cursor: pointer;
+}
 .next_page, .previous_page {
 	text-transform: capitalize;
 	padding: 0 2px;

+ 2 - 6
Themes/default/scripts/script.js

@@ -719,10 +719,6 @@ function expandPages(spanNode, baseURL, firstPage, lastPage, perPage)
 	var replacement = '', i, oldLastPage = 0;
 	var perPageLimit = 50;
 
-	// The dots were bold, the page numbers are not (in most cases).
-	spanNode.style.fontWeight = 'normal';
-	spanNode.onclick = '';
-
 	// Prevent too many pages to be loaded at once.
 	if ((lastPage - firstPage) / perPage > perPageLimit)
 	{
@@ -735,10 +731,10 @@ function expandPages(spanNode, baseURL, firstPage, lastPage, perPage)
 		replacement += '<a class="navPages" href="' + baseURL.replace(/%1\$d/, i).replace(/%%/g, '%') + '">' + (1 + i / perPage) + '</a> ';
 
 	if (oldLastPage > 0)
-		replacement += '<span style="font-weight: bold; cursor: pointer" onclick="expandPages(this, \'' + baseURL + '\', ' + lastPage + ', ' + oldLastPage + ', ' + perPage + ');"> ... </span> ';
+		replacement += '<span class="expand_pages" onclick="expandPages(this, \'' + baseURL + '\', ' + lastPage + ', ' + oldLastPage + ', ' + perPage + ');"><strong> ... </strong></span>';
 
 	// Replace the dots by the new page links.
-	setInnerHTML(spanNode, replacement);
+	setOuterHTML(spanNode, replacement);
 }
 
 function smc_preCacheImage(sSrc)