debian-mirror-gitlab/app/assets/javascripts/branches/init_delete_branch_button.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

36 lines
781 B
JavaScript
Raw Normal View History

2021-09-04 01:27:46 +05:30
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),
},
}),
});
}