mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-21 02:29:23 +00:00
feature(cloudcmd) --name: add ability to set tab name in web browser
This commit is contained in:
parent
9ef0dd02dd
commit
9cdca9efe5
12 changed files with 93 additions and 20 deletions
|
|
@ -13,7 +13,9 @@ const Images = require('../dom/images');
|
|||
const Events = require('../dom/events');
|
||||
const Files = require('../dom/files');
|
||||
|
||||
const {Dialog} = DOM;
|
||||
const {getTitle} = require('../../common/cloudfunc');
|
||||
|
||||
const {Dialog, setTitle} = DOM;
|
||||
|
||||
const TITLE = 'Config';
|
||||
const alert = currify(Dialog.alert, TITLE);
|
||||
|
|
@ -200,7 +202,9 @@ function onChange(el) {
|
|||
const data = input.getValue(name, Element);
|
||||
const type = el.type;
|
||||
|
||||
if (type === 'checkbox')
|
||||
if (name === 'name')
|
||||
onNameChange(data);
|
||||
else if (type === 'checkbox')
|
||||
if (/^(diff|buffer|dirStorage)$/.test(name))
|
||||
onLSChange(name, data);
|
||||
else if (name === 'localStorage')
|
||||
|
|
@ -287,6 +291,12 @@ function onAuthChange(checked) {
|
|||
elPassword.disabled = !checked;
|
||||
}
|
||||
|
||||
function onNameChange(name) {
|
||||
setTitle(getTitle({
|
||||
name
|
||||
}));
|
||||
}
|
||||
|
||||
function onKey({keyCode, target}) {
|
||||
switch (keyCode) {
|
||||
case Key.ESC:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue