environment_actions.js.es6 1.01 KB
Newer Older
1 2 3 4 5 6 7 8
const Vue = require('vue');

module.exports = Vue.component('actions-component', {
  props: {
    actions: {
      type: Array,
      required: false,
      default: () => [],
9
    },
Filipa Lacerda's avatar
Filipa Lacerda committed
10

11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
    playIconSvg: {
      type: String,
      required: false,
    },
  },

  template: `
    <div class="inline">
      <div class="dropdown">
        <a class="dropdown-new btn btn-default" data-toggle="dropdown">
          <span class="js-dropdown-play-icon-container" v-html="playIconSvg"></span>
          <i class="fa fa-caret-down"></i>
        </a>

        <ul class="dropdown-menu dropdown-menu-align-right">
          <li v-for="action in actions">
            <a :href="action.play_path"
              data-method="post"
              rel="nofollow"
              class="js-manual-action-link">

              <span class="js-action-play-icon-container" v-html="playIconSvg"></span>

              <span>
                {{action.name}}
              </span>
            </a>
          </li>
        </ul>
40
      </div>
41 42 43
    </div>
  `,
});