Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
b4113dba
Commit
b4113dba
authored
Jan 31, 2017
by
Phil Hughes
Committed by
Fatih Acet
Feb 03, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Uses mixins for repeated functions
parent
cf5396d4
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
26 additions
and
10 deletions
+26
-10
app/assets/javascripts/boards/boards_bundle.js.es6
app/assets/javascripts/boards/boards_bundle.js.es6
+2
-1
app/assets/javascripts/boards/components/modal/empty_state.js.es6
...ts/javascripts/boards/components/modal/empty_state.js.es6
+2
-1
app/assets/javascripts/boards/components/modal/footer.js.es6
app/assets/javascripts/boards/components/modal/footer.js.es6
+3
-5
app/assets/javascripts/boards/components/modal/header.js.es6
app/assets/javascripts/boards/components/modal/header.js.es6
+2
-1
app/assets/javascripts/boards/components/modal/tabs.js.es6
app/assets/javascripts/boards/components/modal/tabs.js.es6
+3
-2
app/assets/javascripts/boards/mixins/modal_mixins.js.es6
app/assets/javascripts/boards/mixins/modal_mixins.js.es6
+14
-0
No files found.
app/assets/javascripts/boards/boards_bundle.js.es6
View file @
b4113dba
...
@@ -91,6 +91,7 @@ $(() => {
...
@@ -91,6 +91,7 @@ $(() => {
});
});
gl.IssueBoardsModalAddBtn = new Vue({
gl.IssueBoardsModalAddBtn = new Vue({
mixins: [gl.issueBoards.ModalMixins],
el: '#js-add-issues-btn',
el: '#js-add-issues-btn',
data: {
data: {
modal: ModalStore.store,
modal: ModalStore.store,
...
@@ -106,7 +107,7 @@ $(() => {
...
@@ -106,7 +107,7 @@ $(() => {
class="btn btn-create pull-right prepend-left-10 has-tooltip"
class="btn btn-create pull-right prepend-left-10 has-tooltip"
type="button"
type="button"
:disabled="disabled"
:disabled="disabled"
@click="
modal.showAddIssuesModal = true
">
@click="
toggleModal(true)
">
Add issues
Add issues
</button>
</button>
`,
`,
...
...
app/assets/javascripts/boards/components/modal/empty_state.js.es6
View file @
b4113dba
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
const ModalStore = gl.issueBoards.ModalStore;
const ModalStore = gl.issueBoards.ModalStore;
gl.issueBoards.ModalEmptyState = Vue.extend({
gl.issueBoards.ModalEmptyState = Vue.extend({
mixins: [gl.issueBoards.ModalMixins],
data() {
data() {
return ModalStore.store;
return ModalStore.store;
},
},
...
@@ -56,7 +57,7 @@
...
@@ -56,7 +57,7 @@
<button
<button
type="button"
type="button"
class="btn btn-default"
class="btn btn-default"
@click="
activeTab = 'all'
"
@click="
changeTab('all')
"
v-if="activeTab === 'selected'">
v-if="activeTab === 'selected'">
All issues
All issues
</button>
</button>
...
...
app/assets/javascripts/boards/components/modal/footer.js.es6
View file @
b4113dba
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
const ModalStore = gl.issueBoards.ModalStore;
const ModalStore = gl.issueBoards.ModalStore;
gl.issueBoards.ModalFooter = Vue.extend({
gl.issueBoards.ModalFooter = Vue.extend({
mixins: [gl.issueBoards.ModalMixins],
data() {
data() {
return ModalStore.store;
return ModalStore.store;
},
},
...
@@ -18,9 +19,6 @@
...
@@ -18,9 +19,6 @@
},
},
},
},
methods: {
methods: {
hideModal() {
this.showAddIssuesModal = false;
},
addIssues() {
addIssues() {
const list = this.selectedList;
const list = this.selectedList;
const selectedIssues = ModalStore.getSelectedIssues();
const selectedIssues = ModalStore.getSelectedIssues();
...
@@ -37,7 +35,7 @@
...
@@ -37,7 +35,7 @@
list.issuesSize += 1;
list.issuesSize += 1;
});
});
this.
hideModal(
);
this.
toggleModal(false
);
},
},
},
},
components: {
components: {
...
@@ -62,7 +60,7 @@
...
@@ -62,7 +60,7 @@
<button
<button
class="btn btn-default pull-right"
class="btn btn-default pull-right"
type="button"
type="button"
@click="
hideModal
">
@click="
toggleModal(false)
">
Cancel
Cancel
</button>
</button>
</footer>
</footer>
...
...
app/assets/javascripts/boards/components/modal/header.js.es6
View file @
b4113dba
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
const ModalStore = gl.issueBoards.ModalStore;
const ModalStore = gl.issueBoards.ModalStore;
gl.issueBoards.IssuesModalHeader = Vue.extend({
gl.issueBoards.IssuesModalHeader = Vue.extend({
mixins: [gl.issueBoards.ModalMixins],
data() {
data() {
return ModalStore.store;
return ModalStore.store;
},
},
...
@@ -36,7 +37,7 @@
...
@@ -36,7 +37,7 @@
class="close"
class="close"
data-dismiss="modal"
data-dismiss="modal"
aria-label="Close"
aria-label="Close"
@click="
showAddIssuesModal = false
">
@click="
toggleModal(false)
">
<span aria-hidden="true">×</span>
<span aria-hidden="true">×</span>
</button>
</button>
</h2>
</h2>
...
...
app/assets/javascripts/boards/components/modal/tabs.js.es6
View file @
b4113dba
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
const ModalStore = gl.issueBoards.ModalStore;
const ModalStore = gl.issueBoards.ModalStore;
gl.issueBoards.ModalTabs = Vue.extend({
gl.issueBoards.ModalTabs = Vue.extend({
mixins: [gl.issueBoards.ModalMixins],
data() {
data() {
return ModalStore.store;
return ModalStore.store;
},
},
...
@@ -21,7 +22,7 @@
...
@@ -21,7 +22,7 @@
<a
<a
href="#"
href="#"
role="button"
role="button"
@click.prevent="
activeTab = 'all'
">
@click.prevent="
changeTab('all')
">
<span>All issues</span>
<span>All issues</span>
<span class="badge">
<span class="badge">
{{ issuesCount }}
{{ issuesCount }}
...
@@ -32,7 +33,7 @@
...
@@ -32,7 +33,7 @@
<a
<a
href="#"
href="#"
role="button"
role="button"
@click.prevent="
activeTab = 'selected'
">
@click.prevent="
changeTab('selected')
">
<span>Selected issues</span>
<span>Selected issues</span>
<span class="badge">
<span class="badge">
{{ selectedCount }}
{{ selectedCount }}
...
...
app/assets/javascripts/boards/mixins/modal_mixins.js.es6
0 → 100644
View file @
b4113dba
(() => {
const ModalStore = gl.issueBoards.ModalStore;
gl.issueBoards.ModalMixins = {
methods: {
toggleModal(toggle) {
ModalStore.store.showAddIssuesModal = toggle;
},
changeTab(tab) {
ModalStore.store.activeTab = tab;
},
},
};
})();
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment