Use .prop() in place of .attr() in appropriate places
Signed-off-by: Madhura Jayaratne <madhura.cj@gmail.com>
This commit is contained in:
parent
b7696eb558
commit
096c5d4ac0
@ -62,12 +62,10 @@ function setFieldValue(field, field_type, value)
|
||||
switch (field_type) {
|
||||
case 'text':
|
||||
case 'number':
|
||||
//TODO: replace to .val()
|
||||
field.attr('value', (value !== undefined ? value : field.attr('defaultValue')));
|
||||
field.val(value !== undefined ? value : field.attr('defaultValue'));
|
||||
break;
|
||||
case 'checkbox':
|
||||
//TODO: replace to .prop()
|
||||
field.attr('checked', (value !== undefined ? value : field.attr('defaultChecked')));
|
||||
field.prop('checked', (value !== undefined ? value : field.attr('defaultChecked')));
|
||||
break;
|
||||
case 'select':
|
||||
var options = field.prop('options');
|
||||
|
||||
@ -197,14 +197,14 @@ var PMA_console = {
|
||||
}
|
||||
PMA_console.$requestForm.children('textarea').val(queryString);
|
||||
if(options && options.db) {
|
||||
PMA_console.$requestForm.children('[name=db]').attr('value', options.db);
|
||||
PMA_console.$requestForm.children('[name=db]').val(options.db);
|
||||
if(options.table) {
|
||||
PMA_console.$requestForm.children('[name=table]').attr('value', options.table);
|
||||
PMA_console.$requestForm.children('[name=table]').val(options.table);
|
||||
} else {
|
||||
PMA_console.$requestForm.children('[name=table]').attr('value', '');
|
||||
PMA_console.$requestForm.children('[name=table]').val('');
|
||||
}
|
||||
} else {
|
||||
PMA_console.$requestForm.children('[name=db]').attr('value',
|
||||
PMA_console.$requestForm.children('[name=db]').val(
|
||||
(PMA_commonParams.get('db').length > 0 ? PMA_commonParams.get('db') : ''));
|
||||
}
|
||||
PMA_console.$requestForm.find('[name=profiling]').remove();
|
||||
@ -215,7 +215,7 @@ var PMA_console = {
|
||||
return;
|
||||
}
|
||||
PMA_console.$requestForm.children('[name=console_message_id]')
|
||||
.attr('value', PMA_consoleMessages.appendQuery({sql_query: queryString}).message_id);
|
||||
.val(PMA_consoleMessages.appendQuery({sql_query: queryString}).message_id);
|
||||
PMA_console.$requestForm.trigger('submit');
|
||||
PMA_consoleInput.clear();
|
||||
},
|
||||
|
||||
@ -323,7 +323,7 @@ function createAliasModal(event) {
|
||||
isEmpty = false;
|
||||
}
|
||||
});
|
||||
$('input#btn_alias_config').attr('checked', !isEmpty);
|
||||
$('input#btn_alias_config').prop('checked', !isEmpty);
|
||||
},
|
||||
position: 'center'
|
||||
});
|
||||
|
||||
@ -698,9 +698,9 @@ AJAX.registerOnload('normalization.js', function() {
|
||||
var strColsRight = $(this).next().next().html();
|
||||
var colsRight = strColsRight.split(',');
|
||||
for (var i in colsRight) {
|
||||
$('form[data-colname="'+colsRight[i].trim()+'"] input[type="checkbox"]').removeAttr('checked');
|
||||
$('form[data-colname="'+colsRight[i].trim()+'"] input[type="checkbox"]').prop('checked', false);
|
||||
for (var j in colsLeft) {
|
||||
$('form[data-colname="'+colsRight[i].trim()+'"] input[value="'+colsLeft[j].trim()+'"]').attr('checked','checked');
|
||||
$('form[data-colname="'+colsRight[i].trim()+'"] input[value="'+colsLeft[j].trim()+'"]').prop('checked', true);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@ -308,7 +308,7 @@ function applyFunctionToAllRows(currId, functionName, copySalt, salt, targetRows
|
||||
}
|
||||
|
||||
if (copySalt) {
|
||||
$("#salt_" + targetSelectList.attr("id")).attr("value", salt);
|
||||
$("#salt_" + targetSelectList.attr("id")).val(salt);
|
||||
}
|
||||
} else {
|
||||
var id = targetSelectList.attr("id");
|
||||
|
||||
@ -279,7 +279,7 @@ AJAX.registerOnload('tbl_chart.js', function () {
|
||||
if (type == 'bar' || type == 'column' || type == 'area') {
|
||||
$('span.barStacked').show();
|
||||
} else {
|
||||
$('input[name="barStacked"]').attr('checked', false);
|
||||
$('input[name="barStacked"]').prop('checked', false);
|
||||
$.extend(true, currentSettings, {stackSeries : false});
|
||||
$('span.barStacked').hide();
|
||||
}
|
||||
@ -292,15 +292,15 @@ AJAX.registerOnload('tbl_chart.js', function () {
|
||||
var $valueColumn = $('select[name="chartValueColumn"]');
|
||||
var $chartSeries = $('select[name="chartSeries"]');
|
||||
if ($(this).is(':checked')) {
|
||||
$seriesColumn.attr('disabled', false);
|
||||
$valueColumn.attr('disabled', false);
|
||||
$chartSeries.attr('disabled', true);
|
||||
$seriesColumn.prop('disabled', false);
|
||||
$valueColumn.prop('disabled', false);
|
||||
$chartSeries.prop('disabled', true);
|
||||
currentSettings.seriesColumn = parseInt($seriesColumn.val(), 10);
|
||||
currentSettings.valueColumn = parseInt($valueColumn.val(), 10);
|
||||
} else {
|
||||
$seriesColumn.attr('disabled', true);
|
||||
$valueColumn.attr('disabled', true);
|
||||
$chartSeries.attr('disabled', false);
|
||||
$seriesColumn.prop('disabled', true);
|
||||
$valueColumn.prop('disabled', true);
|
||||
$chartSeries.prop('disabled', false);
|
||||
currentSettings.seriesColumn = null;
|
||||
currentSettings.valueColumn = null;
|
||||
}
|
||||
|
||||
@ -321,7 +321,7 @@ AJAX.registerOnload('tbl_select.js', function () {
|
||||
|
||||
// If target field is a select list.
|
||||
if ($target_field.is('select')) {
|
||||
$target_field.attr('value', final_value);
|
||||
$target_field.val(final_value);
|
||||
var $options = $target_field.find('option');
|
||||
var $closest_min = null;
|
||||
var $closest_max = null;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user