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 { ...@@ -108,7 +108,7 @@ export default {
openForm() { openForm() {
if (!this.showForm) { if (!this.showForm) {
this.showForm = true; this.showForm = true;
this.store.formState = Object.assign(this.store.formState, { this.store.setFormState({
title: this.state.titleText, title: this.state.titleText,
confidential: this.isConfidential, confidential: this.isConfidential,
description: this.state.descriptionText, description: this.state.descriptionText,
...@@ -126,7 +126,9 @@ export default { ...@@ -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 confirm('Are you sure you want to move this issue to another project?') : true; // eslint-disable-line no-alert
if (!canPostUpdate) { if (!canPostUpdate) {
this.store.formState.updateLoading = false; this.store.setFormState({
updateLoading: false,
});
return; return;
} }
......
...@@ -4,7 +4,7 @@ export default { ...@@ -4,7 +4,7 @@ export default {
this.preAnimation = true; this.preAnimation = true;
this.pulseAnimation = false; this.pulseAnimation = false;
this.$nextTick(() => { setTimeout(() => {
this.preAnimation = false; this.preAnimation = false;
this.pulseAnimation = true; this.pulseAnimation = true;
}); });
......
...@@ -38,4 +38,8 @@ export default class Store { ...@@ -38,4 +38,8 @@ export default class Store {
description: this.state.descriptionText !== data.description_text, description: this.state.descriptionText !== data.description_text,
}; };
} }
setFormState(state) {
this.formState = Object.assign(this.formState, state);
}
} }
...@@ -77,7 +77,9 @@ import './shortcuts_navigation'; ...@@ -77,7 +77,9 @@ import './shortcuts_navigation';
ShortcutsIssuable.prototype.editIssue = function() { ShortcutsIssuable.prototype.editIssue = function() {
var $editBtn; var $editBtn;
$editBtn = $('.issuable-edit'); $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) { ShortcutsIssuable.prototype.openSidebarDropdown = function(name) {
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
<template> <template>
<div <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"> ref="gl-form">
<markdown-header <markdown-header
:preview-markdown="previewMarkdown" :preview-markdown="previewMarkdown"
......
...@@ -16,12 +16,24 @@ ...@@ -16,12 +16,24 @@
toolbarButton, toolbarButton,
}, },
methods: { methods: {
toggleMarkdownPreview(e) { toggleMarkdownPreview(e, form) {
e.target.blur(); if (form && !form.find('.js-vue-markdown-field').length) {
return;
} else if (e.target.blur) {
e.target.blur();
}
this.$emit('toggle-markdown'); 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> </script>
......
---
title: Enables inline editing for an issues title & description
merge_request:
author:
...@@ -287,7 +287,7 @@ describe('Issuable output', () => { ...@@ -287,7 +287,7 @@ describe('Issuable output', () => {
}); });
}); });
it('stops polling when deleteing', (done) => { it('stops polling when deleting', (done) => {
spyOn(gl.utils, 'visitUrl'); spyOn(gl.utils, 'visitUrl');
spyOn(vm.poll, 'stop'); spyOn(vm.poll, 'stop');
spyOn(vm.service, 'deleteIssuable').and.callFake(() => new Promise((resolve) => { 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