mirror of
https://github.com/discourse/discourse.git
synced 2025-02-20 13:49:29 +08:00
Clear old text and URL when showing up the "Insert Hyperink" modal. (#6138)
This commit is contained in:
parent
f540020d1d
commit
44a5c29d42
|
@ -874,6 +874,9 @@ export default Ember.Component.extend({
|
|||
return;
|
||||
}
|
||||
|
||||
this.set("linkUrl", "");
|
||||
this.set("linkText", "");
|
||||
|
||||
this._lastSel = this._getSelected();
|
||||
|
||||
if (this._lastSel) {
|
||||
|
@ -947,9 +950,6 @@ export default Ember.Component.extend({
|
|||
this._selectText(sel.start + 1, origLink.length);
|
||||
}
|
||||
}
|
||||
|
||||
this.set("linkUrl", "");
|
||||
this.set("linkText", "");
|
||||
},
|
||||
|
||||
emoji() {
|
||||
|
|
|
@ -241,6 +241,17 @@ testCase("link modal (cancel)", function(assert) {
|
|||
});
|
||||
});
|
||||
|
||||
testCase("link modal (cancel clears inputs)", async function(assert) {
|
||||
await click("button.link");
|
||||
await fillIn(".insert-link input.link-url", "https://meta.discourse.org/");
|
||||
await fillIn(".insert-link input.link-text", "Discourse Meta");
|
||||
await click(".insert-link button.btn-danger");
|
||||
|
||||
await click("button.link");
|
||||
assert.equal(this.$(".insert-link input.link-url")[0].value, "");
|
||||
assert.equal(this.$(".insert-link input.link-text")[0].value, "");
|
||||
});
|
||||
|
||||
testCase("link modal (simple link)", function(assert, textarea) {
|
||||
click("button.link");
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user