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