From c8e39b09659728e5a452f9e7b26077f509c1d865 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 30 Aug 2013 18:22:58 +0530 Subject: [PATCH] [fix] [minor] use prop instead of attr to disable a field --- accounts/doctype/sales_invoice/pos.js | 2 +- public/js/website_utils.js | 4 ++-- stock/page/stock_ledger/stock_ledger.js | 4 ++-- stock/page/stock_level/stock_level.js | 4 ++-- utilities/demo/demo-login.js | 6 +++--- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/accounts/doctype/sales_invoice/pos.js b/accounts/doctype/sales_invoice/pos.js index 1bd6de1030..b5a781cd09 100644 --- a/accounts/doctype/sales_invoice/pos.js +++ b/accounts/doctype/sales_invoice/pos.js @@ -395,7 +395,7 @@ erpnext.POS = Class.extend({ }); dialog.show(); - dialog.get_input("total_amount").attr("disabled", "disabled"); + dialog.get_input("total_amount").prop("disabled", true); dialog.fields_dict.pay.input.onclick = function() { cur_frm.set_value("mode_of_payment", dialog.get_values().mode_of_payment); diff --git a/public/js/website_utils.js b/public/js/website_utils.js index 95cae1bbc6..d22d7655fc 100644 --- a/public/js/website_utils.js +++ b/public/js/website_utils.js @@ -18,7 +18,7 @@ erpnext.send_message = function(opts) { wn.call = function(opts) { if(opts.btn) { - $(opts.btn).attr("disabled", "disabled"); + $(opts.btn).prop("disabled", true); } if(opts.msg) { @@ -51,7 +51,7 @@ wn.call = function(opts) { dataType: "json", success: function(data) { if(opts.btn) { - $(opts.btn).attr("disabled", false); + $(opts.btn).prop("disabled", false); } if(data.exc) { if(opts.btn) { diff --git a/stock/page/stock_ledger/stock_ledger.js b/stock/page/stock_ledger/stock_ledger.js index dacd78c21e..c83fc0ec12 100644 --- a/stock/page/stock_ledger/stock_ledger.js +++ b/stock/page/stock_ledger/stock_ledger.js @@ -100,11 +100,11 @@ erpnext.StockLedger = erpnext.StockGridReport.extend({ toggle_enable_brand: function() { if(!this.filter_inputs.item_code.val()) { - this.filter_inputs.brand.removeAttr("disabled"); + this.filter_inputs.brand.prop("disabled", false); } else { this.filter_inputs.brand .val(this.filter_inputs.brand.get(0).opts.default_value) - .attr("disabled", "disabled"); + .prop("disabled", true); } }, diff --git a/stock/page/stock_level/stock_level.js b/stock/page/stock_level/stock_level.js index 0699b7d7cd..df7c8c5d4d 100644 --- a/stock/page/stock_level/stock_level.js +++ b/stock/page/stock_level/stock_level.js @@ -115,11 +115,11 @@ erpnext.StockLevel = erpnext.StockGridReport.extend({ toggle_enable_brand: function() { if(!this.filter_inputs.item_code.val()) { - this.filter_inputs.brand.removeAttr("disabled"); + this.filter_inputs.brand.prop("disabled", false); } else { this.filter_inputs.brand .val(this.filter_inputs.brand.get(0).opts.default_value) - .attr("disabled", "disabled"); + .prop("disabled", true); } }, diff --git a/utilities/demo/demo-login.js b/utilities/demo/demo-login.js index 229d1690e5..509057b9ef 100644 --- a/utilities/demo/demo-login.js +++ b/utilities/demo/demo-login.js @@ -3,7 +3,7 @@ $(document).ready(function() { $("#login_btn").click(function() { var me = this; - $(this).html("Logging In...").attr("disabled", "disabled"); + $(this).html("Logging In...").prop("disabled", true); wn.call({ "method": "login", args: { @@ -12,7 +12,7 @@ $(document).ready(function() { lead_email: $("#lead-email").val(), }, callback: function(r) { - $(me).attr("disabled", false); + $(me).prop("disabled", false); if(r.exc) { alert("Error, please contact support@erpnext.com"); } else { @@ -23,5 +23,5 @@ $(document).ready(function() { }) return false; }) - .attr("disabled", false); + .prop("disabled", false); }) \ No newline at end of file