mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-20 18:18:56 +00:00
feature(edit) add showMessage
This commit is contained in:
parent
055d4ca2d1
commit
8896434fc9
1 changed files with 39 additions and 1 deletions
|
|
@ -11,6 +11,7 @@ var CloudCmd, Util, DOM, JsDiff, ace;
|
|||
Value,
|
||||
Edit = this,
|
||||
Ace,
|
||||
Msg,
|
||||
Key = CloudCmd.Key,
|
||||
Images = DOM.Images,
|
||||
|
||||
|
|
@ -121,7 +122,12 @@ var CloudCmd, Util, DOM, JsDiff, ace;
|
|||
var lPath = DOM.getCurrentPath(),
|
||||
lValue = Ace.getValue();
|
||||
|
||||
DOM.RESTfull.save(lPath, lValue);
|
||||
DOM.RESTfull.save(lPath, lValue, function() {
|
||||
var name = DOM.getCurrentName(),
|
||||
msg = 'save: ok("' + name + '")';
|
||||
|
||||
Edit.showMessage(msg);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -152,6 +158,38 @@ var CloudCmd, Util, DOM, JsDiff, ace;
|
|||
Edit.show();
|
||||
}
|
||||
}
|
||||
|
||||
this.showMessage = function(text) {
|
||||
var parent,
|
||||
TWO_SECONDS = 2000;
|
||||
|
||||
if (!Msg) {
|
||||
DOM.cssSet({
|
||||
id : 'msg-css',
|
||||
inner : '.msg {' +
|
||||
'z-index' + ': 1;' +
|
||||
'background-color' + ': white;' +
|
||||
'color' + ': rgb(49, 123, 249);' +
|
||||
'position' + ': fixed;' +
|
||||
'left' + ': 40%;' +
|
||||
'padding' + ': 5px;' +
|
||||
'opacity' + ': 0.9;' +
|
||||
'transition' + ': ease 0.5s;' +
|
||||
'}'
|
||||
});
|
||||
parent = Element;//.parentElement;
|
||||
|
||||
Msg = DOM.anyload({
|
||||
name : 'div',
|
||||
className : 'msg',
|
||||
parent : parent
|
||||
});
|
||||
}
|
||||
|
||||
Msg.innerHTML = text;
|
||||
DOM.show(Msg);
|
||||
setTimeout(Util.retExec(DOM.hide, Msg), 2000);
|
||||
};
|
||||
}
|
||||
|
||||
})(CloudCmd, Util, DOM);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue