Disable buttons by using ".attr('disable', 'true')" instead of ".unbind()"

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@7587 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
phamt 2010-09-22 20:18:21 +00:00
parent b36b47a6c8
commit 1aefbcca67
6 changed files with 18 additions and 61 deletions

View File

@ -252,11 +252,7 @@ zvmPlugin.prototype.loadClonePage = function(node) {
$('#' + statBarId).show();
// Disable clone button
$(this).unbind(event);
$(this).css( {
'background-color' : '#F2F2F2',
'color' : '#BDBDBD'
});
$(this).attr('disabled', 'true');
} else {
alert('(Error) ' + errMsg);
}

View File

@ -155,7 +155,6 @@ function loadUserEntry(data) {
});
// Disable save button
$(this).unbind(event);
$(this).hide();
cancelBtn.hide();
});
@ -1725,12 +1724,8 @@ function createZProvisionExisting(inst) {
// If all inputs are valid, ready to provision
if (ready) {
// Disable provision button
$(this).unbind(event);
$(this).css( {
'background-color' : '#F2F2F2',
'color' : '#BDBDBD'
});
$(this).attr('disabled', 'true');
// Show loader
$('#zProvisionStatBar' + inst).show();
$('#zProvisionLoader' + inst).show();
@ -2040,22 +2035,15 @@ function createZProvisionNew(inst) {
// If user clicks Ok
if (confirm(msg)) {
// Disable provision button
$(this).unbind('click');
$(this).css( {
'background-color' : '#F2F2F2',
'color' : '#BDBDBD'
});
$(this).attr('disabled', 'true');
// Show loader
$('#zProvisionStatBar' + inst).show();
$('#zProvisionLoader' + inst).show();
// Disable add disk button
addDiskLink.unbind('click');
addDiskLink.css( {
'color' : '#BDBDBD'
});
addDiskLink.attr('disabled', 'true');
// Disable close button on disk table
$('#' + thisTabId + ' table span').unbind('click');
@ -2109,22 +2097,15 @@ function createZProvisionNew(inst) {
*/
// Disable provision button
$(this).unbind(event);
$(this).css( {
'background-color' : '#F2F2F2',
'color' : '#BDBDBD'
});
$(this).attr('disabled', 'true');
// Show loader
$('#zProvisionStatBar' + inst).show();
$('#zProvisionLoader' + inst).show();
// Disable add disk button
addDiskLink.unbind('click');
addDiskLink.css( {
'color' : '#BDBDBD'
});
addDiskLink.attr('disabled', 'true');
// Disable close button on disk table
$('#' + thisTabId + ' table span').unbind('click');

View File

@ -635,7 +635,7 @@ function loadNodes(data) {
powerCol.bind('click', function(event) {
refreshPowerStatus(group);
});
/**
* Get power and ping status for each node
*/
@ -979,11 +979,7 @@ function loadUnlockPage(tgtNodes) {
statusBar.show();
// Disable Ok button
$(this).unbind(event);
$(this).css( {
'background-color' : '#F2F2F2',
'color' : '#BDBDBD'
});
$(this).attr('disabled', 'true');
}
});
@ -1213,11 +1209,7 @@ function deleteNode(tgtNodes) {
statBar.show();
// Disable delete button
$(this).unbind(event);
$(this).css( {
'background-color' : '#F2F2F2',
'color' : '#BDBDBD'
});
$(this).attr('disabled', 'true');
});
var cancelBtn = createButton('Cancel');

View File

@ -154,11 +154,7 @@ function loadNodesetPage(tgtNodes) {
var profile = $('#' + tabId + ' input[name=profile]').val();
// Disable Ok button
$(this).unbind(event);
$(this).css( {
'background-color' : '#F2F2F2',
'color' : '#424242'
});
$(this).attr('disabled', 'true');
/**
* (1) Set the OS, arch, and profile

View File

@ -148,11 +148,7 @@ function loadNetbootPage(tgtNodes) {
}
// Disable Ok button
$(this).unbind(event);
$(this).css( {
'background-color' : '#F2F2F2',
'color' : '#424242'
});
$(this).attr('disabled', 'true');
/**
* (1) Boot to network

View File

@ -278,12 +278,8 @@ function loadUpdatenodePage(tgtNodes) {
var tgts = $('#' + newTabId + ' input[name=target]').val();
// Disable Ok button
$(this).unbind(event);
$(this).css( {
'background-color' : '#F2F2F2',
'color' : '#424242'
});
$(this).attr('disabled', 'true');
/**
* (1) Boot to network
*/