PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.8
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.8
4.4.8 4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 4.1.7.3.2 4.2.0 All 139 releases
learnpress / inc / admin / views / quiz / pagination.php

pagination.php in LearnPress – WordPress LMS Plugin for Create and Sell Online Courses 4.4.8, at inc/admin/views/quiz/pagination.php

79 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Template choose quiz pagination.
4 *
5 * @since 3.0.0
6 */
7 ?>
8
9 <script type="text/x-template" id="tmpl-lp-quiz-pagination">
10 <div id="lp-quiz-pagination" class="pagination" v-if="totalPage > 1">
11 <form prevent.submit="">
12 <button class="button first" :disabled="page == 1" v-if="total > 3 && page > 1 && page != 2"
13 @click.prevent="previousFirstPage">«
14 </button>
15 <button class="button previous" :disabled="page == 1"
16 @click.prevent="previousPage"><?php echo esc_html_x( 'Previous', 'page-navigation', 'learnpress' ); ?></button>
17 <button class="button next" :disabled="page == total"
18 @click.prevent="nextPage"><?php echo esc_html_x( 'Next', 'page-navigation', 'learnpress' ); ?></button>
19 <button class="button last" :disabled="page == total"
20 v-if="total > 3 && page < total && page != (total - 1)"
21 @click.prevent="nextLastPage">»
22 </button>
23 <span class="index">{{page}} / {{total}}</span>
24 </form>
25 </div>
26 </script>
27
28 <script type="text/javascript">
29 jQuery(function ($) {
30 var $Vue = window.$Vue || Vue;
31 var $store = window.LP_Quiz_Store;
32
33 $Vue.component('lp-quiz-pagination', {
34 template: '#tmpl-lp-quiz-pagination',
35 props: ['total'],
36 data: function () {
37 return {
38 page: 1
39 }
40 },
41 computed: {
42 totalPage: function () {
43 return this.total;
44 }
45 },
46 methods: {
47 update: function () {
48 this.$emit('update', this.page);
49 },
50 nextPage: function () {
51 if (this.page < this.total) {
52 this.page++;
53 this.update();
54 }
55 },
56 nextLastPage: function () {
57 if (this.page < this.total) {
58 this.page = this.total;
59 this.update();
60 }
61 },
62 previousPage: function () {
63 if (this.page > 1) {
64 this.page--;
65 this.update();
66 }
67 },
68 previousFirstPage: function () {
69 if (this.page > 1) {
70 this.page = 1;
71 this.update();
72 }
73 }
74 }
75 });
76
77 })
78 </script>
79