Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/branches/init_delete_branch_button.js')
-rw-r--r--app/assets/javascripts/branches/init_delete_branch_button.js35
1 files changed, 35 insertions, 0 deletions
diff --git a/app/assets/javascripts/branches/init_delete_branch_button.js b/app/assets/javascripts/branches/init_delete_branch_button.js
new file mode 100644
index 00000000000..43df5d993a4
--- /dev/null
+++ b/app/assets/javascripts/branches/init_delete_branch_button.js
@@ -0,0 +1,35 @@
+import Vue from 'vue';
+import DeleteBranchButton from '~/branches/components/delete_branch_button.vue';
+import { parseBoolean } from '~/lib/utils/common_utils';
+
+export default function initDeleteBranchButton(el) {
+ if (!el) {
+ return false;
+ }
+
+ const {
+ branchName,
+ defaultBranchName,
+ deletePath,
+ tooltip,
+ disabled,
+ isProtectedBranch,
+ merged,
+ } = el.dataset;
+
+ return new Vue({
+ el,
+ render: (createElement) =>
+ createElement(DeleteBranchButton, {
+ props: {
+ branchName,
+ defaultBranchName,
+ deletePath,
+ tooltip,
+ disabled: parseBoolean(disabled),
+ isProtectedBranch: parseBoolean(isProtectedBranch),
+ merged: parseBoolean(merged),
+ },
+ }),
+ });
+}