From cc1e51efa7706a738e2c64693da67013638fede6 Mon Sep 17 00:00:00 2001 From: "Luke \"Jared\" Bennett" Date: Wed, 7 Jun 2017 11:18:35 +0100 Subject: Added report issuable feature --- app/assets/javascripts/merge_request.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'app/assets/javascripts/merge_request.js') diff --git a/app/assets/javascripts/merge_request.js b/app/assets/javascripts/merge_request.js index f93feeec1c2..c00978bfaea 100644 --- a/app/assets/javascripts/merge_request.js +++ b/app/assets/javascripts/merge_request.js @@ -4,6 +4,7 @@ import 'vendor/jquery.waitforimages'; import './task_list'; import './merge_request_tabs'; +import CloseReopenReportToggle from './close_reopen_report_toggle'; (function() { this.MergeRequest = (function() { @@ -24,6 +25,7 @@ import './merge_request_tabs'; this.initTabs(); this.initMRBtnListeners(); this.initCommitMessageListeners(); + MergeRequest.initCloseReopenReport(); if ($("a.btn-close").length) { this.taskList = new gl.TaskList({ dataType: 'merge_request', @@ -119,6 +121,21 @@ import './merge_request_tabs'; $el.text(gl.text.addDelimiter(count)); }; + MergeRequest.initCloseReopenReport = function () { + const container = document.querySelector('.js-issuable-close-dropdown'); + const dropdownTrigger = container.querySelector('.js-issuable-close-toggle'); + const dropdownList = container.querySelector('.js-issuable-close-menu'); + const button = container.querySelector('.js-issuable-close-button'); + + const closeReopenReportToggle = new CloseReopenReportToggle({ + dropdownTrigger, + dropdownList, + button, + }); + + closeReopenReportToggle.initDroplab(); + }; + return MergeRequest; })(); }).call(window); -- cgit v1.2.1