| 1 |
<?php |
| 2 |
/** |
| 3 |
* Template added items preview. |
| 4 |
* |
| 5 |
* @since 3.0.0 |
| 6 |
*/ |
| 7 |
|
| 8 |
?> |
| 9 |
|
| 10 |
<script type="text/x-template" id="tmpl-lp-added-items-preview"> |
| 11 |
<div class="lp-added-items-preview" :class="{show:show}"> |
| 12 |
<ul class="list-added-items"> |
| 13 |
<template v-for="(item, index) in addedItems"> |
| 14 |
<li @click="removeItem(item)" class="section-item removable" :class="item.type"> |
| 15 |
<input type="checkbox" checked> |
| 16 |
<span class="title">{{item.title}}</span> |
| 17 |
</li> |
| 18 |
</template> |
| 19 |
</ul> |
| 20 |
</div> |
| 21 |
</script> |
| 22 |
|
| 23 |
<script type="text/javascript"> |
| 24 |
window.$Vue = window.$Vue || Vue; |
| 25 |
|
| 26 |
jQuery(function() { |
| 27 |
(function($store) { |
| 28 |
|
| 29 |
$Vue.component('lp-added-items-preview', { |
| 30 |
template: '#tmpl-lp-added-items-preview', |
| 31 |
props: { |
| 32 |
show: true |
| 33 |
}, |
| 34 |
methods: { |
| 35 |
removeItem: function (item) { |
| 36 |
$store.dispatch('ci/removeItem', item); |
| 37 |
} |
| 38 |
}, |
| 39 |
computed: { |
| 40 |
addedItems: function () { |
| 41 |
return $store.getters['ci/addedItems']; |
| 42 |
} |
| 43 |
} |
| 44 |
}); |
| 45 |
})(LP_Curriculum_Store); |
| 46 |
}); |
| 47 |
</script> |
| 48 |
|