PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.1.7
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.1.7
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 4.2.1 All 138 releases
learnpress / inc / admin / views / course / new-section.php

new-section.php in LearnPress – WordPress LMS Plugin for Create and Sell Online Courses 4.1.7, at inc/admin/views/course/new-section.php

56 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Template new section.
5 *
6 * @since 3.0.0
7 */
8
9 ?>
10
11 <script type="text/x-template" id="tmpl-lp-new-section">
12 <div class="section new-section">
13 <form @submit.prevent="">
14 <div class="section-head">
15 <span class="creatable"></span>
16 <input v-model="section_title" type="text" title="title" class="title-input" placeholder="<?php esc_attr_e( 'Create a new section', 'learnpress' ); ?>" @keyup.enter.prevent="newSection">
17 </div>
18 </form>
19 </div>
20 </script>
21
22 <script type="text/javascript">
23 window.$Vue = window.$Vue || Vue;
24
25 jQuery( function( $ ) {
26 ( function( $store ) {
27 $Vue.component( 'lp-new-section', {
28 template: '#tmpl-lp-new-section',
29 data: function() {
30 return {
31 section_title: ''
32 };
33 },
34 methods: {
35 draftCourse: function() {
36 if ( $store.getters['autoDraft'] ) {
37 $store.dispatch( 'draftCourse', {
38 title: $('input[name=post_title]').val(),
39 content: $('textarea[name=content]').val()
40 });
41 }
42 },
43 newSection: function() {
44 if ( this.section_title ) {
45 this.draftCourse();
46
47 $store.dispatch( 'ss/newSection', this.section_title );
48 this.section_title = '';
49 }
50 }
51 }
52 });
53 })( LP_Curriculum_Store );
54 });
55 </script>
56