mirror of
https://github.com/discourse/discourse.git
synced 2025-02-16 18:24:52 -06:00
UX: Copy selected text to the link building modal
This commit is contained in:
parent
782d75069e
commit
86e142b39f
@ -735,6 +735,11 @@ export default Ember.Component.extend({
|
||||
|
||||
showLinkModal() {
|
||||
this._lastSel = this._getSelected();
|
||||
|
||||
if (this._lastSel) {
|
||||
this.set("linkText", this._lastSel.value);
|
||||
}
|
||||
|
||||
this.set('insertLinkHidden', false);
|
||||
},
|
||||
|
||||
|
@ -248,6 +248,9 @@ testCase('link modal (simple link) with selected text', function(assert, textare
|
||||
textarea.selectionEnd = 12;
|
||||
|
||||
click('button.link');
|
||||
andThen(() => {
|
||||
assert.equal(this.$('input.link-text')[0].value, 'hello world.');
|
||||
});
|
||||
fillIn('.insert-link input.link-url', 'http://eviltrout.com');
|
||||
click('.insert-link button.btn-primary');
|
||||
andThen(() => {
|
||||
|
Loading…
Reference in New Issue
Block a user