diff options
author | Phil Hughes <me@iamphill.com> | 2016-08-11 09:51:52 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2016-08-17 17:17:39 +0100 |
commit | 17c576c1acaaa976e4ef99c18d0ff0f3cda4fec4 (patch) | |
tree | 843f8e0d1bd8402beaf40205f8377accb254faad /app/assets/javascripts/boards/boards_bundle.js.es6 | |
parent | 4460724da78b43f8f30c48f7cca8572b413bd76f (diff) | |
download | gitlab-ce-17c576c1acaaa976e4ef99c18d0ff0f3cda4fec4.tar.gz |
Removed underscoreJS uses
Removed props on main VueJS app instead uses data variables
Diffstat (limited to 'app/assets/javascripts/boards/boards_bundle.js.es6')
-rw-r--r-- | app/assets/javascripts/boards/boards_bundle.js.es6 | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/app/assets/javascripts/boards/boards_bundle.js.es6 b/app/assets/javascripts/boards/boards_bundle.js.es6 index 95785bb415c..e965255f6da 100644 --- a/app/assets/javascripts/boards/boards_bundle.js.es6 +++ b/app/assets/javascripts/boards/boards_bundle.js.es6 @@ -7,7 +7,9 @@ //= require_tree ./mixins //= require_tree ./components -$(function () { +$(() => { + const $boardApp = $('#board-app'); + if (!window.gl) { window.gl = {}; } @@ -17,38 +19,42 @@ $(function () { } gl.IssueBoardsApp = new Vue({ - el: '#board-app', - props: { - disabled: Boolean, - endpoint: String, - issueLinkBase: String - }, + el: $boardApp.get(0), data: { state: BoardsStore.state, - loading: true + loading: true, + endpoint: $boardApp.data('endpoint'), + disabled: $boardApp.data('disabled'), + issueLinkBase: $boardApp.data('issue-link-base') }, - init: function () { + init () { BoardsStore.create(); }, - created: function () { + created () { this.loading = true; gl.boardService = new BoardService(this.endpoint); + + $boardApp + .removeAttr('data-endpoint') + .removeAttr('data-disabled') + .removeAttr('data-issue-link-base'); }, - ready: function () { + ready () { BoardsStore.disabled = this.disabled; gl.boardService.all() .then((resp) => { const boards = resp.json(); - boards.forEach((board) => { - const list = BoardsStore.addList(board); + for (let i = 0, boardsLength = boards.length; i < boardsLength; i++) { + const board = boards[i], + list = BoardsStore.addList(board); if (list.type === 'done') { - list.position = 9999999; + list.position = Infinity; } else if (list.type === 'backlog') { list.position = -1; } - }); + } BoardsStore.addBlankState(); this.loading = false; |