1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 11:50:30 +02:00
This commit is contained in:
farr3ll
2012-11-30 05:00:20 +02:00
parent f836982f84
commit 84b0c89db9

View File

@@ -11,12 +11,22 @@ $(document).ready(function()
//alert('hello');
if(!target){return true; }
//console.log($('#' + target, window.top.document).attr('value'));
var cursorIndex = $('#' + target, window.top.document).attr("selectionStart");
var lStr = $('#' + target, window.top.document).attr('value').substr(0,cursorIndex) + " " + newval + " ";
var rStr = $('#' + target, window.top.document).attr('value').substr(cursorIndex);
$('#' + target, window.top.document).attr('value',lStr+rStr);
$('#' + target, window.top.document).attr("selectionStart",lStr.length);
//('#' + target, window.top.document).insertAtCaret(newVal);
// $('#' + target, window.parent.document).append(newval); //FIXME caret!!
// var t = $('#' + target, window.parent.document).text();
$('#' + target, window.top.document).attr('value',newval); // set new value
//$('#' + target, window.top.document).attr('value',newval); // set new value
// inserttext(newval,target);
// alert(newval);
});