mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-20 18:18:56 +00:00
feature(config) disable username and password if auth unchecked
This commit is contained in:
parent
0894b802eb
commit
d3a401b6d7
1 changed files with 14 additions and 1 deletions
|
|
@ -74,10 +74,13 @@ var CloudCmd, Util, DOM;
|
|||
inputs = DOM.getByTag(INPUT, div);
|
||||
inputFirst = inputs[0];
|
||||
|
||||
if (inputFirst)
|
||||
if (inputFirst) {
|
||||
onAuthChange(inputFirst.checked);
|
||||
|
||||
focus = function() {
|
||||
inputFirst.focus();
|
||||
};
|
||||
}
|
||||
|
||||
Util.forEach(inputs, function(input) {
|
||||
Events.add('change', input, onChange)
|
||||
|
|
@ -134,6 +137,8 @@ var CloudCmd, Util, DOM;
|
|||
onLSChange(data);
|
||||
else if (el.id === 'dirStorage')
|
||||
onLSChange(data);
|
||||
else if (el.id === 'auth')
|
||||
onAuthChange(data);
|
||||
|
||||
break;
|
||||
case 'number':
|
||||
|
|
@ -192,6 +197,14 @@ var CloudCmd, Util, DOM;
|
|||
return element.checked;
|
||||
}
|
||||
|
||||
function onAuthChange(checked) {
|
||||
var elUsername = DOM.getById('username', Element),
|
||||
elPassword = DOM.getById('password', Element);
|
||||
|
||||
elUsername.disabled =
|
||||
elPassword.disabled = !checked;
|
||||
}
|
||||
|
||||
function onKey(event) {
|
||||
var keyCode = event.keyCode,
|
||||
ESC = Key.ESC;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue