2
0
forked from Wavyzz/dolibarr

[Qual] Use jQuery property instead of attribute to test and set disabled

This commit is contained in:
Raphaël Doursenaud
2015-05-12 14:47:33 +02:00
parent 0d8641a073
commit e149d49fb8
11 changed files with 74 additions and 74 deletions

View File

@@ -132,7 +132,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt
// Disable an element
if (options.option_disabled) {
if (ui.item.disabled) {
$("#" + options.option_disabled).attr("disabled", "disabled");
$("#" + options.option_disabled).prop("disabled", true);
if (options.error) {
$.jnotify(options.error, "error", true); // Output with jnotify the error message
}
@@ -145,7 +145,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt
}
if (options.disabled) {
$.each(options.disabled, function(key, value) {
$("#" + value).attr("disabled", "disabled");
$("#" + value).prop("disabled", true);
});
}
if (options.show) {
@@ -524,7 +524,7 @@ function ajax_object_onoff($object, $code, $field, $text_on, $text_off, $input=a
// Disable another element
if (input.disabled && input.disabled.length > 0) {
$.each(input.disabled, function(key,value) {
$("#" + value).attr("disabled", true);
$("#" + value).prop("disabled", true);
if ($("#" + value).hasClass("butAction") == true) {
$("#" + value).removeClass("butAction");
$("#" + value).addClass("butActionRefused");