gitlab-org--gitlab-foss/app/assets/javascripts/boards/boards_bundle.js.es6

43 lines
893 B
JavaScript
Raw Normal View History

2016-07-28 11:33:04 +00:00
//= require vue
//= require vue-resource
//= require Sortable
2016-08-01 13:18:30 +00:00
//= require_tree ./models
2016-07-28 11:33:04 +00:00
//= require_tree ./stores
//= require_tree ./services
//= require_tree ./components
$(function () {
if (!window.gl) {
window.gl = {};
}
gl.boardService = new BoardService($('#board-app').data('endpoint'));
2016-07-28 11:33:04 +00:00
if (gl.IssueBoardsApp) {
gl.IssueBoardsApp.$destroy(true);
BoardsStore.reset();
}
gl.IssueBoardsApp = new Vue({
2016-07-28 11:33:04 +00:00
el: '#board-app',
data: {
state: BoardsStore.state
},
ready: function () {
gl.boardService.all()
2016-07-28 11:33:04 +00:00
.then((resp) => {
2016-08-02 08:58:09 +00:00
const boards = resp.json();
boards.forEach((board) => {
const list = BoardsStore.new(board, false);
if (list.type === 'done') {
list.position = 9999999;
}
2016-07-28 11:33:04 +00:00
});
BoardsStore.addBlankState();
2016-07-28 11:33:04 +00:00
});
}
});
});