diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2016-11-18 14:08:12 +0300 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2016-11-18 14:08:12 +0300 |
commit | d0552ade9882ebbd247f65812b17b2f01776eaa5 (patch) | |
tree | 21fd511976ae6f9145cf2985a87130c93eee3d75 /app/assets/javascripts | |
parent | 120c53cde2bba0d6616c9c4b1948d557399594aa (diff) |
Try to use slots
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r-- | app/assets/javascripts/environments/components/environment_actions.js.es6 | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/app/assets/javascripts/environments/components/environment_actions.js.es6 b/app/assets/javascripts/environments/components/environment_actions.js.es6 index ca1a5861f30..2bac40b3c6f 100644 --- a/app/assets/javascripts/environments/components/environment_actions.js.es6 +++ b/app/assets/javascripts/environments/components/environment_actions.js.es6 @@ -23,39 +23,38 @@ * */ mounted() { - const playIcon = document.querySelector('.play-icon-svg.hidden svg'); - - const dropdownContainer = this.$el.querySelector('.dropdown-play-icon-container'); - const actionContainers = this.$el.querySelectorAll('.action-play-icon-container'); - // Phantomjs does not have support to iterate a nodelist. - const actionsArray = [].slice.call(actionContainers); - - if (playIcon && actionsArray && dropdownContainer) { - dropdownContainer.appendChild(playIcon.cloneNode(true)); - - actionsArray.forEach((element) => { - element.appendChild(playIcon.cloneNode(true)); - }); - } + // const playIcon = document.querySelector('.play-icon-svg.hidden svg'); + // + // const dropdownContainer = this.$el.querySelector('.dropdown-play-icon-container'); + // const actionContainers = this.$el.querySelectorAll('.action-play-icon-container'); + // // Phantomjs does not have support to iterate a nodelist. + // const actionsArray = [].slice.call(actionContainers); + // + // if (playIcon && actionsArray && dropdownContainer) { + // dropdownContainer.appendChild(playIcon.cloneNode(true)); + // + // actionsArray.forEach((element) => { + // element.appendChild(playIcon.cloneNode(true)); + // }); + // } }, template: ` <div class="inline"> <div class="dropdown"> <a class="dropdown-new btn btn-default" data-toggle="dropdown"> - <span class="dropdown-play-icon-container"> - <!-- svg goes here --> - </span> + <slot name="actionplayicon"></slot> <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="action-play-icon-container"> - <!-- svg goes here --> - </span> - <span v-html="action.name"></span> + <a :href="action.play_path" + data-method="post" + rel="nofollow" + class="js-manual-action-link"> + <slot name="actionplayicon"></slot> + <span v-html="action.name"></span> </a> </li> </ul> |