User Tools

Site Tools


html

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
html [2012-04-28 10:49 CEST]
dominik another version of textarea-tab
html [2012-04-28 11:05 CEST] (current)
dominik [After refactoring]
Line 82: Line 82:
  
 (function(fn) { (function(fn) {
- if(document.addEventListener) { //​W3C-compliant browser+ if (document.addEventListener) { // W3C-compliant browser
  document.addEventListener("​DOMContentLoaded",​ fn, false);  document.addEventListener("​DOMContentLoaded",​ fn, false);
- } else { // IE+ } else { // Internet Explorer
  document.onreadystatechange = function() {  document.onreadystatechange = function() {
- if(document.readyState == "​interactive"​ || document.readyState == "​complete"​) {+ if (document.readyState == "​interactive"​ || document.readyState == "​complete"​) {
  fn();  fn();
  }  }
Line 106: Line 106:
       var endPos = e.selectionEnd;​       var endPos = e.selectionEnd;​
       var scrollTop = e.scrollTop;​       var scrollTop = e.scrollTop;​
-      e.value = e.value.substring(0,​ startPos)+myValue+e.value.substring(endPos,​e.value.length);​+      e.value = e.value.substring(0,​ startPos) + myValue + e.value.substring(endPos,​e.value.length);​
       e.focus();       e.focus();
       e.selectionStart = startPos + myValue.length;​       e.selectionStart = startPos + myValue.length;​
html.txt · Last modified: 2012-04-28 11:05 CEST by dominik