2016-10-04 14:27:02 +00:00
|
|
|
(() => {
|
|
|
|
const Store = gl.issueBoards.BoardsStore;
|
|
|
|
|
|
|
|
window.gl = window.gl || {};
|
|
|
|
window.gl.issueBoards = window.gl.issueBoards || {};
|
|
|
|
|
|
|
|
gl.issueBoards.BoardSidebar = Vue.extend({
|
2016-10-05 11:20:59 +00:00
|
|
|
props: {
|
|
|
|
currentUser: Object
|
|
|
|
},
|
2016-10-04 14:27:02 +00:00
|
|
|
data() {
|
|
|
|
return {
|
2016-10-05 07:49:40 +00:00
|
|
|
detail: Store.detail,
|
|
|
|
issue: {}
|
2016-10-04 14:27:02 +00:00
|
|
|
};
|
|
|
|
},
|
2016-10-05 07:49:40 +00:00
|
|
|
computed: {
|
|
|
|
showSidebar () {
|
|
|
|
return Object.keys(this.issue).length;
|
|
|
|
}
|
2016-10-04 14:27:02 +00:00
|
|
|
},
|
|
|
|
watch: {
|
2016-10-05 07:49:40 +00:00
|
|
|
detail: {
|
2016-10-04 14:27:02 +00:00
|
|
|
handler () {
|
2016-10-05 07:49:40 +00:00
|
|
|
this.issue = this.detail.issue;
|
2016-10-04 14:27:02 +00:00
|
|
|
},
|
|
|
|
deep: true
|
2016-10-05 07:49:40 +00:00
|
|
|
},
|
|
|
|
issue () {
|
|
|
|
if (this.showSidebar) {
|
|
|
|
this.$nextTick(() => {
|
2016-10-19 21:26:51 +00:00
|
|
|
this.issuableContext = new IssuableContext(this.currentUser);
|
|
|
|
this.milestoneSelect = new MilestoneSelect();
|
|
|
|
this.dueDateSelect = new gl.DueDateSelectors();
|
|
|
|
this.labelsSelect = new LabelsSelect();
|
|
|
|
this.sidebar = new Sidebar();
|
|
|
|
this.subscription = new Subscription('.subscription');
|
2016-10-05 07:49:40 +00:00
|
|
|
});
|
|
|
|
} else {
|
|
|
|
$('.right-sidebar').getNiceScroll().remove();
|
2016-10-19 21:26:51 +00:00
|
|
|
|
|
|
|
delete this.issuableContext;
|
|
|
|
delete this.milestoneSelect;
|
|
|
|
delete this.dueDateSelect;
|
|
|
|
delete this.labelsSelect;
|
|
|
|
delete this.sidebar;
|
|
|
|
delete this.subscription;
|
2016-10-05 07:49:40 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
closeSidebar () {
|
|
|
|
this.detail.issue = {};
|
2016-10-04 14:27:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
})();
|