mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 02:16:41 +02:00
MDL-72223 atto_link: link text should match selected text.
Rather then using all text of the currently selected node, instead use that text the user has currently selected.
This commit is contained in:
parent
0d0e66d37c
commit
2661214376
4 changed files with 4 additions and 4 deletions
|
@ -203,7 +203,7 @@ Y.namespace('M.atto_link').Button = Y.Base.create('button', Y.M.editor_atto.Edit
|
|||
}
|
||||
} else {
|
||||
// User is selecting some text before clicking on the Link button.
|
||||
textToDisplay = Y.one(selectednode).get('textContent');
|
||||
textToDisplay = window.getSelection().toString();
|
||||
if (textToDisplay !== '') {
|
||||
this._hasTextToDisplay = true;
|
||||
this._content.one(SELECTORS.URLTEXT).set('value', textToDisplay);
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -203,7 +203,7 @@ Y.namespace('M.atto_link').Button = Y.Base.create('button', Y.M.editor_atto.Edit
|
|||
}
|
||||
} else {
|
||||
// User is selecting some text before clicking on the Link button.
|
||||
textToDisplay = Y.one(selectednode).get('textContent');
|
||||
textToDisplay = window.getSelection().toString();
|
||||
if (textToDisplay !== '') {
|
||||
this._hasTextToDisplay = true;
|
||||
this._content.one(SELECTORS.URLTEXT).set('value', textToDisplay);
|
||||
|
|
|
@ -201,7 +201,7 @@ Y.namespace('M.atto_link').Button = Y.Base.create('button', Y.M.editor_atto.Edit
|
|||
}
|
||||
} else {
|
||||
// User is selecting some text before clicking on the Link button.
|
||||
textToDisplay = Y.one(selectednode).get('textContent');
|
||||
textToDisplay = window.getSelection().toString();
|
||||
if (textToDisplay !== '') {
|
||||
this._hasTextToDisplay = true;
|
||||
this._content.one(SELECTORS.URLTEXT).set('value', textToDisplay);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue