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
|
|
@ -74,6 +74,7 @@ module.exports.show = (options) => {
|
||||||
setMsgChanged(name);
|
setMsgChanged(name);
|
||||||
|
|
||||||
CloudCmd.Edit
|
CloudCmd.Edit
|
||||||
|
.setInfo(name)
|
||||||
.getEditor()
|
.getEditor()
|
||||||
.setValueFirst(path, data)
|
.setValueFirst(path, data)
|
||||||
.setModeForPath(name)
|
.setModeForPath(name)
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,15 @@ let Loading = true;
|
||||||
let Element;
|
let Element;
|
||||||
let editor;
|
let editor;
|
||||||
|
|
||||||
|
let InfoElement;
|
||||||
|
|
||||||
const ConfigView = {
|
const ConfigView = {
|
||||||
|
beforeClose: () => {
|
||||||
|
document.body.removeChild(InfoElement);
|
||||||
|
},
|
||||||
afterShow: () => {
|
afterShow: () => {
|
||||||
|
document.body.appendChild(InfoElement);
|
||||||
|
|
||||||
editor
|
editor
|
||||||
.moveCursorTo(0, 0)
|
.moveCursorTo(0, 0)
|
||||||
.focus();
|
.focus();
|
||||||
|
|
@ -28,6 +35,7 @@ const ConfigView = {
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports.init = async () => {
|
module.exports.init = async () => {
|
||||||
|
createInfoElement();
|
||||||
const element = createElement();
|
const element = createElement();
|
||||||
|
|
||||||
await CloudCmd.View();
|
await CloudCmd.View();
|
||||||
|
|
@ -99,6 +107,22 @@ module.exports.hide = () => {
|
||||||
CloudCmd.View.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 loadFiles = promisify((element, callback) => {
|
||||||
const socketPath = CloudCmd.PREFIX;
|
const socketPath = CloudCmd.PREFIX;
|
||||||
const prefix = socketPath + '/' + EditorName;
|
const prefix = socketPath + '/' + EditorName;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue