mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
feature(edit) add info text
This commit is contained in:
parent
adbfb95012
commit
85e46bb94b
2 changed files with 25 additions and 0 deletions
|
|
@ -19,8 +19,15 @@ let Loading = true;
|
|||
let Element;
|
||||
let editor;
|
||||
|
||||
let InfoElement;
|
||||
|
||||
const ConfigView = {
|
||||
beforeClose: () => {
|
||||
document.body.removeChild(InfoElement);
|
||||
},
|
||||
afterShow: () => {
|
||||
document.body.appendChild(InfoElement);
|
||||
|
||||
editor
|
||||
.moveCursorTo(0, 0)
|
||||
.focus();
|
||||
|
|
@ -28,6 +35,7 @@ const ConfigView = {
|
|||
};
|
||||
|
||||
module.exports.init = async () => {
|
||||
createInfoElement();
|
||||
const element = createElement();
|
||||
|
||||
await CloudCmd.View();
|
||||
|
|
@ -99,6 +107,22 @@ module.exports.hide = () => {
|
|||
CloudCmd.View.hide();
|
||||
};
|
||||
|
||||
module.exports.setInfo = (info) => {
|
||||
InfoElement.textContent = info;
|
||||
return this;
|
||||
};
|
||||
|
||||
function createInfoElement() {
|
||||
InfoElement = load({
|
||||
name: 'div',
|
||||
style:
|
||||
'top: 0;' +
|
||||
'left: 20px;' +
|
||||
'position: fixed;',
|
||||
inner: '',
|
||||
});
|
||||
}
|
||||
|
||||
const loadFiles = promisify((element, callback) => {
|
||||
const socketPath = CloudCmd.PREFIX;
|
||||
const prefix = socketPath + '/' + EditorName;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue