mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-28 18:23:35 +00:00
feature(config) set value after receive response about saving
This commit is contained in:
parent
1e27733c38
commit
481dd61949
1 changed files with 19 additions and 1 deletions
|
|
@ -84,7 +84,10 @@ var CloudCmd, Util, DOM;
|
|||
|
||||
Util.forEach(inputs, function(input) {
|
||||
Events.add('change', input, onChange)
|
||||
.addKey(input, onKey);
|
||||
.addKey(input, onKey)
|
||||
.addClick(input, function(event) {
|
||||
event.preventDefault();
|
||||
});
|
||||
});
|
||||
|
||||
CloudCmd.View.show(div, {
|
||||
|
|
@ -148,6 +151,7 @@ var CloudCmd, Util, DOM;
|
|||
Config.write(obj, function() {
|
||||
CONFIG[name] = data;
|
||||
DOM.Files.set('config', CONFIG);
|
||||
setValue(el, data);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -171,6 +175,20 @@ var CloudCmd, Util, DOM;
|
|||
return data;
|
||||
}
|
||||
|
||||
function setValue(el, value) {
|
||||
var type = el.type;
|
||||
|
||||
switch(type) {
|
||||
case 'checkbox':
|
||||
el.checked = value;
|
||||
break;
|
||||
|
||||
default:
|
||||
el.value = value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function onLocalStorageChange(checked) {
|
||||
var elDiff = DOM.getById('diff', Element),
|
||||
elBuffer = DOM.getById('buffer', Element),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue