Commit df7c9011 authored by Phil Hughes's avatar Phil Hughes

fixed issuable shortcuts not working

moved setstate method into store
parent 3465e1e5
......@@ -108,7 +108,7 @@ export default {
openForm() {
if (!this.showForm) {
this.showForm = true;
this.store.formState = Object.assign(this.store.formState, {
this.store.setFormState({
title: this.state.titleText,
confidential: this.isConfidential,
description: this.state.descriptionText,
......@@ -126,7 +126,9 @@ export default {
confirm('Are you sure you want to move this issue to another project?') : true; // eslint-disable-line no-alert
if (!canPostUpdate) {
this.store.formState.updateLoading = false;
this.store.setFormState({
updateLoading: false,
});
return;
}
......
......@@ -4,7 +4,7 @@ export default {
this.preAnimation = true;
this.pulseAnimation = false;
this.$nextTick(() => {
setTimeout(() => {
this.preAnimation = false;
this.pulseAnimation = true;
});
......
......@@ -38,4 +38,8 @@ export default class Store {
description: this.state.descriptionText !== data.description_text,
};
}
setFormState(state) {
this.formState = Object.assign(this.formState, state);
}
}
......@@ -77,7 +77,9 @@ import './shortcuts_navigation';
ShortcutsIssuable.prototype.editIssue = function() {
var $editBtn;
$editBtn = $('.issuable-edit');
return gl.utils.visitUrl($editBtn.attr('href'));
// Need to click the element as on issues, editing is inline
// on merge request, editing is on a different page
$editBtn.get(0).click();
};
ShortcutsIssuable.prototype.openSidebarDropdown = function(name) {
......
......@@ -69,7 +69,7 @@
<template>
<div
class="md-area prepend-top-default append-bottom-default"
class="md-area prepend-top-default append-bottom-default js-vue-markdown-field"
ref="gl-form">
<markdown-header
:preview-markdown="previewMarkdown"
......
......@@ -16,12 +16,24 @@
toolbarButton,
},
methods: {
toggleMarkdownPreview(e) {
e.target.blur();
toggleMarkdownPreview(e, form) {
if (form && !form.find('.js-vue-markdown-field').length) {
return;
} else if (e.target.blur) {
e.target.blur();
}
this.$emit('toggle-markdown');
},
},
mounted() {
$(document).on('markdown-preview:show.vue', this.toggleMarkdownPreview);
$(document).on('markdown-preview:hide.vue', this.toggleMarkdownPreview);
},
beforeDestroy() {
$(document).on('markdown-preview:show.vue', this.toggleMarkdownPreview);
$(document).off('markdown-preview:hide.vue', this.toggleMarkdownPreview);
},
};
</script>
......
---
title: Enables inline editing for an issues title & description
merge_request:
author:
......@@ -287,7 +287,7 @@ describe('Issuable output', () => {
});
});
it('stops polling when deleteing', (done) => {
it('stops polling when deleting', (done) => {
spyOn(gl.utils, 'visitUrl');
spyOn(vm.poll, 'stop');
spyOn(vm.service, 'deleteIssuable').and.callFake(() => new Promise((resolve) => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment