webif/var/mongoose/html/js/tabsupport.js
hummypkg aadac18796 add editor
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@753 2a923420-c742-0410-a762-8d5b09965624
2012-02-22 01:14:12 +00:00

24 lines
466 B
JavaScript

(function($)
{
$.fn.tabsupport = function()
{
return this.each(function() {
$(this).keydown(function(e) {
if (e.keyCode == 9)
{
var el = $(this).get(0);
var start = el.selectionStart;
var end = el.selectionEnd;
$(this).val(
$(this).val().substring(0, start) +
"\t" +
$(this).val().substring(end)
);
el.selectionStart = el.selectionEnd = start + 1;
return false;
}
});
});
}
})(jQuery);