Skip to content

Commit

Permalink
Only load markdown editor where needed (RecipeView)
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Robitaille <[email protected]>
  • Loading branch information
MarcelRobitaille committed Jul 26, 2022
1 parent daaf7bd commit ccdc8e6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
9 changes: 9 additions & 0 deletions src/components/RecipeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,9 @@
</template>

<script>
import Vue from "vue"
import moment from "@nextcloud/moment"
import VueShowdown from "vue-showdown"
import api from "cookbook/js/api-interface"
import helpers from "cookbook/js/helper"
Expand All @@ -268,6 +270,13 @@ import RecipeNutritionInfoItem from "./RecipeNutritionInfoItem.vue"
import RecipeTimer from "./RecipeTimer.vue"
import RecipeTool from "./RecipeTool.vue"
// Markdown for Vue
// Used by RecipeTool, RecipeInstruction, and RecipeIngredient
Vue.use(VueShowdown, {
// set default flavor for Markdown
flavor: "vanilla",
})
export default {
name: "RecipeView",
components: {
Expand Down
9 changes: 1 addition & 8 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
*/

// Markdown
import VueShowdown from "vue-showdown"
import moment from 'moment'
import moment from "moment"

import { generateUrl } from "@nextcloud/router"

Expand Down Expand Up @@ -56,12 +55,6 @@ if (__webpack_use_dev_server__ || false) {
Vue.prototype.$window = window
Vue.prototype.OC = OC

// Markdown for Vue
Vue.use(VueShowdown, {
// set default flavor for Markdown
flavor: "vanilla",
})

// Pass translation engine to Vue
Vue.prototype.t = window.t

Expand Down

0 comments on commit ccdc8e6

Please sign in to comment.