From 3c88f3ea340073e1764463880b10a29c3dbb06f3 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Mon, 3 Dec 2012 15:23:11 +0530 Subject: [PATCH] email_doc:bufix, autoselect in float, number fields --- public/js/legacy/widgets/form/fields.js | 14 +++++++------- public/js/wn/views/communication.js | 7 ++++--- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/public/js/legacy/widgets/form/fields.js b/public/js/legacy/widgets/form/fields.js index 7eebf669c4..716b09d319 100644 --- a/public/js/legacy/widgets/form/fields.js +++ b/public/js/legacy/widgets/form/fields.js @@ -814,10 +814,16 @@ FloatField.prototype.validate = function(v) { FloatField.prototype.format_input = function() { if(this.input.value==null) this.input.value=''; } +FloatField.prototype.onmake_input = function() { + if(!this.input) return; + this.input.onfocus = function() { + this.select(); + } +} // ====================================================================================== -function CurrencyField() { } CurrencyField.prototype = new DataField(); +function CurrencyField() { } CurrencyField.prototype = new FloatField(); CurrencyField.prototype.format_input = function() { var v = fmt_money(this.input.value); if(this.not_in_form) { @@ -835,12 +841,6 @@ CurrencyField.prototype.set_disp = function(val) { var v = fmt_money(val); this.set_disp_html(v); } -CurrencyField.prototype.onmake_input = function() { - if(!this.input) return; - this.input.onfocus = function() { - if(flt(this.value)==0)this.select(); - } -} // ====================================================================================== diff --git a/public/js/wn/views/communication.js b/public/js/wn/views/communication.js index 1638e89bea..e746d50e0d 100644 --- a/public/js/wn/views/communication.js +++ b/public/js/wn/views/communication.js @@ -164,10 +164,11 @@ wn.views.CommunicationComposer = Class.extend({ var fields = this.dialog.fields_dict; if(this.attach_document_print) { - $(fields.send_me_a_copy.input).click(); - $(fields.attach_document_print.input).click(); + $(fields.send_me_a_copy.input).click(); + $(fields.attach_document_print.input).click(); + $(fields.select_print_format.wrapper).toggle(true); } - + $(fields.send_email.input).attr("checked", "checked") $(fields.add_reply.input).click(function() { var form_values = me.dialog.get_values();