mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: anchor, target, and title are not set on a link that's inserted without selection. Also when using createElement in that way firefox encodes the spaces within href parameter breaking the shortcodes. Switched to using the 'mctmp' placeholder now.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@96623 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
57e8693dc9
commit
d5a04edf02
14
javascript/tiny_mce_improvements.js
vendored
14
javascript/tiny_mce_improvements.js
vendored
@ -242,20 +242,24 @@ LinkForm.prototype = {
|
||||
else ed.dom.setAttrib(e, k, v);
|
||||
});
|
||||
};
|
||||
|
||||
function replace() {
|
||||
tinymce.each(ed.dom.select('a'), function(e) {
|
||||
if (e.href == 'javascript:mctmp(0);') set(e);
|
||||
});
|
||||
}
|
||||
|
||||
if(attributes.innerHTML && !ed.selection.getContent()) {
|
||||
if(tinymce.isIE) var rng = ed.selection.getRng();
|
||||
e = ed.getDoc().createElement('a');
|
||||
e.innerHTML = attributes.innerHTML;
|
||||
e.href = attributes.href;
|
||||
e.href = 'javascript:mctmp(0);';
|
||||
s.setNode(e);
|
||||
if(tinymce.isIE) tinyMCE.activeEditor.selection.setRng(rng);
|
||||
replace();
|
||||
}
|
||||
if (!e) {
|
||||
ed.execCommand('CreateLink', false, 'javascript:mctmp(0);');
|
||||
tinymce.each(ed.dom.select('a'), function(e) {
|
||||
if (e.href == 'javascript:mctmp(0);') set(e);
|
||||
});
|
||||
replace();
|
||||
} else {
|
||||
if (attributes.href)
|
||||
set(e);
|
||||
|
Loading…
Reference in New Issue
Block a user