[ticket/10731] Fixed addquote() to work on opera browser.

In opera, window.getSelection() returned incorrect values, should be using
document.getSelection() instead. Fixed in prosilver and subsilver2 templates.

PHPBB3-10731
This commit is contained in:
Hari Sankar R 2012-04-01 18:25:50 +05:30 committed by Vjacheslav Trushkin
parent 3477b5e5a8
commit b1b530f92c
2 changed files with 4 additions and 4 deletions

View file

@ -219,7 +219,7 @@ function addquote(post_id, username, l_wrote)
// Get text selection - not only the post content :( // Get text selection - not only the post content :(
// IE9 must use the document.selection method but has the *.getSelection so we just force no IE // IE9 must use the document.selection method but has the *.getSelection so we just force no IE
if (window.getSelection && !is_ie) if (window.getSelection && !is_ie && !window.opera)
{ {
theSelection = window.getSelection().toString(); theSelection = window.getSelection().toString();
} }
@ -456,4 +456,4 @@ function getCaretPosition(txtarea)
} }
return caretPos; return caretPos;
} }

View file

@ -221,7 +221,7 @@ function addquote(post_id, username, l_wrote)
// Get text selection - not only the post content :( // Get text selection - not only the post content :(
// IE9 must use the document.selection method but has the *.getSelection so we just force no IE // IE9 must use the document.selection method but has the *.getSelection so we just force no IE
if (window.getSelection && !is_ie) if (window.getSelection && !is_ie && !window.opera)
{ {
theSelection = window.getSelection().toString(); theSelection = window.getSelection().toString();
} }
@ -459,4 +459,4 @@ function getCaretPosition(txtarea)
} }
return caretPos; return caretPos;
} }