summary refs log tree commit diff
diff options
context:
space:
mode:
authormayx2022-01-27 19:54:46 +0000
committermayx2022-01-27 19:54:46 +0000
commit77057bedf88ef2cb1905c4b2de5d7cc85cb3c99a (patch)
tree3015252eaeb8e395d0be9bed484c66e1b3dc6127
parent28810075bcd1bde772617aa225662cd1a7fa49c6 (diff)
Update index.html
-rw-r--r--index.html11
1 files changed, 1 insertions, 10 deletions
diff --git a/index.html b/index.html
index aaec710..a919bbe 100644
--- a/index.html
+++ b/index.html
@@ -23,15 +23,6 @@ title: 首页 - 我的文章
 {% endfor %}
 </table>
 {% if paginator.total_pages > 1 %}
-<script>
-  function switchPage(sobj){
-    if (sobj.value == 1){
-      window.location = "{{ '/index.html' | prepend: site.baseurl | replace: '//', '/' }}";
-    } else {
-      window.location = "{{ '/page' | prepend: site.baseurl | replace: '//', '/' }}" + sobj.value + "/";
-    }
-  }
-</script>
 <div class="pagination">
   {% if paginator.previous_page %}
     {% if paginator.previous_page == 1 %}
@@ -43,7 +34,7 @@ title: 首页 - 我的文章
     <span>&laquo; Prev</span>
   {% endif %}
 
-<select onchange="switchPage(this)">
+<select onchange="window.location = this.value == 1 ? '{{ '/index.html' | prepend: site.baseurl | replace: '//', '/' }}' : '{{ '/page' | prepend: site.baseurl | replace: '//', '/' }}" + this.value + '/'">
   {% for page in (1..paginator.total_pages) %}
     {% if page == paginator.page %}
       <option value="{{ page }}" selected>{{ page }}</option>