Skip to content

Commit dcf0e3c

Browse files
committed
Make JS IE friendly
replace startsWith and optional function arguments with IE friendly code
1 parent 59a6ac6 commit dcf0e3c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

pagination.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function makePageLink(currentUrl, currentStart, start, linkText) {
1919
var tagStart = '<a href="';
2020
if (currentStart == start) {
2121
uri = "#";
22-
if (!linkText.toString().startsWith("&")) { // Don't modify arrows
22+
if (!linkText.toString().substring(0, 1) === "&") { // Don't modify arrows
2323
tagStart = '<a class="active" href="';
2424
}
2525
}

pasta.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ function showUrl(url) {
138138

139139

140140
// Passes search URL and callbacks to CORS function
141-
function searchPasta(query, coreArea="", start=0) {
141+
function searchPasta(query, coreArea, start) {
142142
var base = PASTA_CONFIG["server"];
143143
var fields = ["title",
144144
"pubdate",
@@ -150,6 +150,7 @@ function searchPasta(query, coreArea="", start=0) {
150150
params += '&fq=keyword:"' + coreArea + '"';
151151
}
152152
var limit = "&rows=" + PASTA_CONFIG["limit"];
153+
if (start === undefined) start = "0";
153154
start = "&start=" + start;
154155
query = "&q=" + query;
155156
var url = base + params + query + limit + start;

0 commit comments

Comments
 (0)