[fix] [minor] use prop instead of attr to disable a field

This commit is contained in:
Anand Doshi 2013-08-30 18:22:58 +05:30
parent f7e5648365
commit c8e39b0965
5 changed files with 10 additions and 10 deletions

View File

@ -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);

View File

@ -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) {

View File

@ -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);
}
},

View File

@ -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);
}
},

View File

@ -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);
})