diff options
Diffstat (limited to 'prosilver/template/editor.js')
-rw-r--r-- | prosilver/template/editor.js | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/prosilver/template/editor.js b/prosilver/template/editor.js index ddc862b..c16b0ef 100644 --- a/prosilver/template/editor.js +++ b/prosilver/template/editor.js @@ -151,8 +151,10 @@ function insert_text(text, spaces, popup) { text = ' ' + text + ' '; } - - if (!isNaN(textarea.selectionStart)) + + // Since IE9, IE also has textarea.selectionStart, but it still needs to be treated the old way. + // Therefore we simply add a !is_ie here until IE fixes the text-selection completely. + if (!isNaN(textarea.selectionStart) && !is_ie) { var sel_start = textarea.selectionStart; var sel_end = textarea.selectionEnd; @@ -216,11 +218,12 @@ function addquote(post_id, username, l_wrote) } // Get text selection - not only the post content :( - if (window.getSelection) + // IE9 must use the document.selection method but has the *.getSelection so we just force no IE + if (window.getSelection && !is_ie && !window.opera) { theSelection = window.getSelection().toString(); } - else if (document.getSelection) + else if (document.getSelection && !is_ie) { theSelection = document.getSelection(); } @@ -453,4 +456,4 @@ function getCaretPosition(txtarea) } return caretPos; -}
\ No newline at end of file +} |