mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-11-10 00:11:22 +08:00
Improve logic for unsharing shared task [SCI-10097] (#7026)
This commit is contained in:
parent
e85f48d51f
commit
5bdfc41f94
1 changed files with 4 additions and 7 deletions
|
|
@ -34,8 +34,8 @@
|
||||||
class="sci-toggle-checkbox"
|
class="sci-toggle-checkbox"
|
||||||
:disabled="!canShare"
|
:disabled="!canShare"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
@change="checkboxChange"
|
@click.prevent="checkboxChange"
|
||||||
@keyup.enter="handleCheckboxEnter"/>
|
@keyup.enter="checkboxChange"/>
|
||||||
<span class="sci-toggle-checkbox-label"></span>
|
<span class="sci-toggle-checkbox-label"></span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -199,12 +199,8 @@ export default {
|
||||||
this.characterCount = this.$refs.textarea.value.length;
|
this.characterCount = this.$refs.textarea.value.length;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleCheckboxEnter() {
|
|
||||||
this.sharedEnabled = !this.sharedEnabled;
|
|
||||||
this.checkboxChange();
|
|
||||||
},
|
|
||||||
checkboxChange() {
|
checkboxChange() {
|
||||||
if (this.sharedEnabled) {
|
if (!this.sharedEnabled) {
|
||||||
$.post(this.shareableLinkUrl, { description: this.description }, (result) => {
|
$.post(this.shareableLinkUrl, { description: this.description }, (result) => {
|
||||||
this.shareableData = result.data;
|
this.shareableData = result.data;
|
||||||
this.$emit('enable');
|
this.$emit('enable');
|
||||||
|
|
@ -224,6 +220,7 @@ export default {
|
||||||
this.shareableData = {};
|
this.shareableData = {};
|
||||||
this.description = '';
|
this.description = '';
|
||||||
this.dirty = false;
|
this.dirty = false;
|
||||||
|
this.sharedEnabled = false;
|
||||||
|
|
||||||
this.$emit('disable');
|
this.$emit('disable');
|
||||||
this.$emit('close');
|
this.$emit('close');
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue