2016-12-14 03:01:05 +00:00
|
|
|
/* eslint-disable comma-dangle, space-before-function-paren, no-new */
|
|
|
|
/* global Vue */
|
|
|
|
/* global IssuableContext */
|
|
|
|
/* global MilestoneSelect */
|
|
|
|
/* global LabelsSelect */
|
|
|
|
/* global Sidebar */
|
|
|
|
|
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-25 12:16:22 +00:00
|
|
|
$('.right-sidebar').getNiceScroll(0).doScrollTop(0, 0);
|
|
|
|
$('.right-sidebar').getNiceScroll().resize();
|
2016-10-05 07:49:40 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
closeSidebar () {
|
|
|
|
this.detail.issue = {};
|
2016-10-04 14:27:02 +00:00
|
|
|
}
|
2016-10-20 07:54:33 +00:00
|
|
|
},
|
2016-11-03 00:37:33 +00:00
|
|
|
mounted () {
|
2016-10-20 07:54:33 +00:00
|
|
|
new IssuableContext(this.currentUser);
|
|
|
|
new MilestoneSelect();
|
|
|
|
new gl.DueDateSelectors();
|
|
|
|
new LabelsSelect();
|
|
|
|
new Sidebar();
|
2016-11-17 15:48:45 +00:00
|
|
|
gl.Subscription.bindAll('.subscription');
|
2016-10-04 14:27:02 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
})();
|