Remove modal dialog

This commit is contained in:
Paulo Gustavo Veiga 2022-01-12 19:27:54 -08:00
parent c80b538a12
commit f3eaed07b2
4 changed files with 0 additions and 59 deletions

View File

@ -1,45 +0,0 @@
/*
* Copyright [2022] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the
* "powered by wisemapping" text requirement on every single page;
* you may not use this file except in compliance with the License.
* You may obtain a copy of the license at
*
* http://www.wisemapping.org/license
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import $ from 'jquery';
class LoadingModal {
constructor() {
this.element = $(
`<div id="load" class="modal fade" data-keyboard="false" data-backdrop="static"
style="display: flex; flex-direction: column; justify-content: center">
<div class="modal-dialog" >
<div style="height: 120px; text-align: center; border: 2px solid orange" class="modal-content">
<img style="margin-top:25px; text-align: center" src="images/ajax-loader.gif">
</div>
</div>
</div>`,
);
this.element.modal('hide');
this.element.appendTo(document.body);
}
show() {
this.element.modal('show');
}
hide() {
this.element.modal('hide');
}
}
export default LoadingModal;

View File

@ -22,7 +22,6 @@ import jquery from 'jquery';
import {
$notify,
} from './components/widget/ToolbarNotifier';
import LoadingModal from './components/widget/LoadingModal';
import {
buildDesigner,
} from './components/DesignerBuilder';
@ -37,9 +36,6 @@ import DesignerOptionsBuilder from './components/DesignerOptionsBuilder';
global.jQuery = jquery;
require('@libraries/bootstrap/js/bootstrap');
const loadingModal = new LoadingModal();
loadingModal.show();
// Configure designer options ...
let persistence:PersistenceManager;
if (!global.memoryPersistence && !global.readOnly) {
@ -71,10 +67,6 @@ const options = DesignerOptionsBuilder.buildOptions(
// Build designer ...
const designer = buildDesigner(options);
designer.addEvent('loadSuccess', () => {
loadingModal.hide();
});
// Load map from XML file persisted on disk...
const instance = PersistenceManager.getInstance();
const mindmap = instance.load(global.mapId);

View File

@ -1,16 +1,12 @@
import '../css/editor.css';
import { buildDesigner } from '../../../../src/components/DesignerBuilder';
import { PersistenceManager, LocalStorageManager } from '../../../../src';
import LoadingModal from '../../../../src/components/widget/LoadingModal';
import DesignerOptionsBuilder from '../../../../src/components/DesignerOptionsBuilder';
// Account details ...
global.accountName = 'Test User';
global.accountEmail = 'test@example.com';
const loadingModal = new LoadingModal();
loadingModal.show();
const p = new LocalStorageManager('samples/{id}.wxml');
const options = DesignerOptionsBuilder.buildOptions({
persistenceManager: p
@ -18,7 +14,6 @@ const options = DesignerOptionsBuilder.buildOptions({
const designer = buildDesigner(options);
designer.addEvent('loadSuccess', () => {
loadingModal.hide();
// Hack for automation testing ...
document.getElementById('mindplot').classList.add('ready');
});

View File

@ -3,7 +3,6 @@ import { buildDesigner } from '../../../../src/components/DesignerBuilder';
import { PersistenceManager, LocalStorageManager } from '../../../../src';
import DesignerOptionsBuilder from '../../../../src/components/DesignerOptionsBuilder';
const p = new LocalStorageManager('samples/{id}.wxml');
const options = DesignerOptionsBuilder.buildOptions({ persistenceManager: p, readOnly: true, saveOnLoad: false });