Skip to content
Snippets Groups Projects
Commit 8ac0b3ca authored by Andreas Gohr's avatar Andreas Gohr
Browse files

get text selection early in linkwizard FS#1820

Ignore-this: 47573bdaf0c547971bb3013c90c4c037

Fixes a problem with the link wizard in MSIE6

darcs-hash:20091215130634-6e07b-d9da628897912a086c0fe5ea5aad49b505fe1a1e.gz
parent 0bda0363
No related branches found
No related tags found
No related merge requests found
...@@ -11,6 +11,7 @@ var linkwiz = { ...@@ -11,6 +11,7 @@ var linkwiz = {
sack: null, sack: null,
textArea: null, textArea: null,
selected: -1, selected: -1,
selection: null,
/** /**
* Initialize the linkwizard by creating the needed HTML * Initialize the linkwizard by creating the needed HTML
...@@ -194,7 +195,10 @@ var linkwiz = { ...@@ -194,7 +195,10 @@ var linkwiz = {
*/ */
insertLink: function(title){ insertLink: function(title){
if(!linkwiz.entry.value) return; if(!linkwiz.entry.value) return;
var sel = getSelection(linkwiz.textArea);
var sel = getSelection(linkwiz.textArea);
if(sel.start == 0 && sel.end == 0) sel = linkwiz.selection;
var stxt = sel.getText(); var stxt = sel.getText();
if(!stxt && !DOKU_UHC) stxt=title; if(!stxt && !DOKU_UHC) stxt=title;
...@@ -250,6 +254,7 @@ var linkwiz = { ...@@ -250,6 +254,7 @@ var linkwiz = {
* Show the linkwizard * Show the linkwizard
*/ */
show: function(){ show: function(){
linkwiz.selection = getSelection(linkwiz.textArea);
linkwiz.wiz.style.marginLeft = '0px'; linkwiz.wiz.style.marginLeft = '0px';
linkwiz.entry.focus(); linkwiz.entry.focus();
linkwiz.autocomplete(); linkwiz.autocomplete();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment