details: http://code.openbravo.com/erp/devel/2.40_cyclone/rev/39103e32f29a changeset: 858:39103e32f29a user: Stefan Hühner <stefan.huehner <at> openbravo.com> date: Fri Aug 14 14:35:30 2009 +0200 summary: [Numberformat] only call onblur and onchange on a field if they are present
details: http://code.openbravo.com/erp/devel/2.40_cyclone/rev/316348bff767 changeset: 859:316348bff767 user: Stefan Hühner <stefan.huehner <at> openbravo.com> date: Fri Aug 14 14:36:21 2009 +0200 summary: [NumberFormat] Remove two recently added,unused js-methods diffstat: web/js/calculator.js | 20 ++++++++++++++++---- web/js/utils.js | 35 ----------------------------------- 2 files changed, 16 insertions(+), 39 deletions(-) diffs (82 lines): diff -r d2e549e9d950 -r 316348bff767 web/js/calculator.js --- a/web/js/calculator.js Fri Aug 14 08:37:06 2009 +0200 +++ b/web/js/calculator.js Fri Aug 14 14:36:21 2009 +0200 @@ -157,8 +157,14 @@ this.out_val = this.slag_1; this.out_val = this.out_val.toString(); this.control_obj.value = this.out_val.replace('.', decSeparator); - if (focusedWindowElement != this.control_obj) { this.control_obj.onblur(); } - this.control_obj.onchange(); + if (focusedWindowElement != this.control_obj) { + if (typeof this.control_obj.onblur == "function") { + this.control_obj.onblur(); + } + } + if (typeof this.control_obj.onchange == "function") { + this.control_obj.onchange(); + } break; case '=': if (this.oper_old != '') { @@ -183,8 +189,14 @@ else this.out_val = this.slag_1; this.out_val = this.out_val.toString(); this.control_obj.value = this.out_val.replace('.', decSeparator); - if (focusedWindowElement != this.control_obj) { this.control_obj.onblur(); } - this.control_obj.onchange(); + if (focusedWindowElement != this.control_obj) { + if (typeof this.control_obj.onblur == "function") { + this.control_obj.onblur(); + } + } + if (typeof this.control_obj.onchange == "function") { + this.control_obj.onchange(); + } break; case 'z': tmp = parseFloat(tmp); diff -r d2e549e9d950 -r 316348bff767 web/js/utils.js --- a/web/js/utils.js Fri Aug 14 08:37:06 2009 +0200 +++ b/web/js/utils.js Fri Aug 14 14:36:21 2009 +0200 @@ -4335,41 +4335,6 @@ setSelectionRange(input, pos, pos); } -function selectString (input, string) { - var match = new RegExp(string, "i").exec(input.value); - if (match) { - setSelectionRange (input, match.index, match.index + match -[0].length); - } -} - -function replaceSelection (input, replaceString) { - if (input.setSelectionRange) { - var selectionStart = input.selectionStart; - var selectionEnd = input.selectionEnd; - input.value = input.value.substring(0, selectionStart) - + replaceString - + input.value.substring(selectionEnd); - if (selectionStart != selectionEnd) // has there been a selection - setSelectionRange(input, selectionStart, selectionStart + replaceString.length); - else // set caret - setCaretToPos(input, selectionStart + replaceString.length); - } - else if (document.selection) { - var range = document.selection.createRange(); - if (range.parentElement() == input) { - var isCollapsed = range.text == ''; - range.text = replaceString; - if (!isCollapsed) { // there has been a selection - // it appears range.select() should select the newly - // inserted text but that fails with IE - range.moveStart('character', -replaceString.length); - range.select(); - } - } - } -} - /** * Function that manage the numeric dot write in the input * @param {Object} obj The input ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Openbravo-commits mailing list Openbravo-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbravo-commits