mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
fix(dom) Dialog
This commit is contained in:
parent
18222286f0
commit
ec8cb4c19a
5 changed files with 20 additions and 19 deletions
|
|
@ -6,8 +6,8 @@ const jonny = require('jonny');
|
|||
const exec = require('execon');
|
||||
|
||||
const Storage = require('./storage');
|
||||
const Dialog = require('./dialog');
|
||||
const DOM = require('./dom');
|
||||
const {Dialog} = DOM;
|
||||
|
||||
module.exports = new BufferProto(DOM, CloudCmd);
|
||||
|
||||
|
|
|
|||
|
|
@ -199,12 +199,6 @@ function CloudCmdProto(Util, DOM, CloudFunc) {
|
|||
if (config.onePanelMode)
|
||||
CloudCmd.MIN_ONE_PANEL_WIDTH = Infinity;
|
||||
|
||||
const {htmlDialogs} = config;
|
||||
|
||||
DOM.Dialog = DOM.Dialog(prefix, {
|
||||
htmlDialogs
|
||||
});
|
||||
|
||||
Util.exec.if(document.body.scrollIntoViewIfNeeded, func, funcBefore);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,16 @@ window.CloudCmd = (config) => {
|
|||
window.Util = require('../common/util');
|
||||
window.CloudFunc = require('../common/cloudfunc');
|
||||
window.DOM = require('./dom');
|
||||
|
||||
const Dialog = require('./dialog');
|
||||
|
||||
const prefix = getPrefix(config.prefix);
|
||||
const {htmlDialogs} = config;
|
||||
|
||||
DOM.Dialog = Dialog(prefix, {
|
||||
htmlDialogs
|
||||
});
|
||||
|
||||
window.CloudCmd = require('./client');
|
||||
|
||||
require('./listeners');
|
||||
|
|
@ -31,7 +41,6 @@ window.CloudCmd = (config) => {
|
|||
.map((name) => `${name}.js`);
|
||||
|
||||
const urlFiles = getJoinURL(allFiles);
|
||||
const prefix = getPrefix(config.prefix);
|
||||
|
||||
createScript(prefix + urlFiles, () => {
|
||||
window.CloudCmd.init(prefix, config);
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ module.exports = DOM;
|
|||
|
||||
DOM.uploadDirectory = require('./directory');
|
||||
DOM.Buffer = require('./buffer');
|
||||
DOM.Dialog = require('./dialog');
|
||||
DOM.Events = require('./events');
|
||||
DOM.Storage = require('./storage');
|
||||
DOM.Files = require('./files');
|
||||
|
|
|
|||
|
|
@ -2,13 +2,12 @@
|
|||
|
||||
const itype = require('itype/legacy');
|
||||
|
||||
/* global CloudFunc, CloudCmd */
|
||||
/* global CloudFunc, CloudCmd, DOM */
|
||||
|
||||
module.exports = new RESTful();
|
||||
|
||||
const {Images} = require('./dom');
|
||||
const load = require('./load');
|
||||
const Dialog = require('./dialog');
|
||||
|
||||
function RESTful() {
|
||||
this.delete = (url, data, callback) => {
|
||||
|
|
@ -184,20 +183,20 @@ function RESTful() {
|
|||
url : p.url,
|
||||
data : p.data,
|
||||
dataType : p.dataType,
|
||||
error : function(jqXHR) {
|
||||
var response = jqXHR.responseText,
|
||||
statusText = jqXHR.statusText,
|
||||
status = jqXHR.status,
|
||||
text = status === 404 ? response : statusText;
|
||||
error : (jqXHR) => {
|
||||
const response = jqXHR.responseText;
|
||||
const statusText = jqXHR.statusText;
|
||||
const status = jqXHR.status;
|
||||
const text = status === 404 ? response : statusText;
|
||||
|
||||
Images.show.error(text);
|
||||
setTimeout(function() {
|
||||
Dialog.alert(CloudCmd.TITLE, text);
|
||||
setTimeout(() => {
|
||||
DOM.Dialog.alert(CloudCmd.TITLE, text);
|
||||
}, 100);
|
||||
|
||||
p.callback(Error(text));
|
||||
},
|
||||
success : function(data) {
|
||||
success: (data) => {
|
||||
Images.hide();
|
||||
|
||||
if (!p.notLog)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue