1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-05-21 02:08:17 +03:00

Доработка markitup для выделения внешнего текста

This commit is contained in:
Mzhelskiy Maxim 2011-08-30 06:21:23 +00:00
parent 679c58b678
commit d2c5fbb5c5

View file

@ -164,7 +164,7 @@
}).click(function() { }).click(function() {
return false; return false;
}).bind("focusin", function(){ }).bind("focusin", function(){
$$.focus(); //$$.focus();
}).mouseup(function() { }).mouseup(function() {
if (button.call) { if (button.call) {
eval(button.call)(); eval(button.call)();
@ -286,6 +286,7 @@
root:options.root, root:options.root,
textarea:textarea, textarea:textarea,
selection:(selection||''), selection:(selection||''),
selectionOuter:(selectionOuter||''),
caretPosition:caretPosition, caretPosition:caretPosition,
ctrlKey:ctrlKey, ctrlKey:ctrlKey,
shiftKey:shiftKey, shiftKey:shiftKey,
@ -413,6 +414,12 @@
// get the selection // get the selection
function get() { function get() {
// get the selection by outer text
if ($.browser.msie) {
selectionOuter=document.selection.createRange().text;
} else {
selectionOuter=document.getSelection();
}
textarea.focus(); textarea.focus();
scrollPosition = textarea.scrollTop; scrollPosition = textarea.scrollTop;