X-Git-Url: http://git.euphorik.ch/?p=euphorik.git;a=blobdiff_plain;f=js%2Futil.js;h=638fa6d9dcefcfee18964664fd3c9ea6e0290e05;hp=c70f7e579629a2e0443dce05c8abcf6c922e8509;hb=7fb422d6d4a7a59c8f74d938371a4a10474e8ea4;hpb=1ab57f78d9f702dc09b1af80f36546c79edfccca diff --git a/js/util.js b/js/util.js index c70f7e5..638fa6d 100644 --- a/js/util.js +++ b/js/util.js @@ -167,8 +167,7 @@ euphorik.Util.prototype.infoBulle = function(message, element, position) { var depassementDroit = (positionMessage.left + m.width()) - $("body").width(); if (depassementDroit > 0) { positionMessage.left -= depassementDroit; - } - else if (positionMessage.left < 0) { + } else if (positionMessage.left < 0) { positionMessage.left = 0; } @@ -200,8 +199,7 @@ euphorik.Util.prototype.setSelectionRange = function(input, selectionStart, sele if (input.setSelectionRange) { input.focus(); input.setSelectionRange(selectionStart, selectionEnd); - } - else if (input.createTextRange) { + } else if (input.createTextRange) { var range = input.createTextRange(); range.collapse(true); range.moveEnd('character', selectionEnd); @@ -233,12 +231,10 @@ euphorik.Util.prototype.replaceSelection = function(input, replaceString) { if (selectionStart != selectionEnd) { // has there been a selection this.setSelectionRange(input, selectionStart, selectionStart + replaceString.length); - } - else { // set caret + } else { // set caret this.setCaretToPos(input, selectionStart + replaceString.length); } - } - else if (document.selection) { + } else if (document.selection) { input.focus(); var range = document.selection.createRange(); if (range.parentElement() == input) {