working on loading dialog

This commit is contained in:
Ezequiel Bergamaschi 2014-03-09 05:42:44 -03:00
parent 907a808151
commit 2ec17259e8
3 changed files with 62 additions and 34 deletions

View File

@ -65,7 +65,7 @@ mindplot.DesignerKeyboard = new Class({
} }
); );
this.addShortcut( this.addShortcut(
'delete', function(event) { 'del', function(event) {
designer.deleteSelectedEntities(); designer.deleteSelectedEntities();
event.preventDefault(); event.preventDefault();
event.stopPropagation(); event.stopPropagation();

View File

@ -36,9 +36,19 @@
}); });
</script> </script>
<style>
#mask {
position:absolute;
z-index:9000;
background-color:#000;
display:none;
}
</style>
</head> </head>
<body> <body>
<div id="mask"></div>
<div id="header"> <div id="header">
<div id="headerInfo"> <div id="headerInfo">

View File

@ -26,8 +26,8 @@ function buildDesigner(options) {
// Register load events ... // Register load events ...
designer = new mindplot.Designer(options, container); designer = new mindplot.Designer(options, container);
designer.addEvent('loadSuccess', function () { designer.addEvent('loadSuccess', function () {
// window.waitDialog.close.delay(1000, window.waitDialog); window.waitDialog.close();
// window.waitDialog = null; window.waitDialog = null;
window.mindmapLoadReady = true; window.mindmapLoadReady = true;
}); });
@ -65,7 +65,7 @@ function buildDesigner(options) {
// Close loading dialog ... // Close loading dialog ...
if (window.waitDialog) { if (window.waitDialog) {
window.waitDialog.close.delay(1000, window.waitDialog); window.waitDialog.close();
window.waitDialog = null; window.waitDialog = null;
} }
@ -142,10 +142,10 @@ function loadDesignerOptions(jsonConf) {
// @Todo: This must be reimplemented using JQuery ... // @Todo: This must be reimplemented using JQuery ...
editor = {}; editor = {};
//editor.WaitDialog = new Class({ editor.WaitDialog = new Class({
// Extends:MooDialog, initialize:function () {
// initialize:function () { this.panel = this._buildPanel();
// var panel = this._buildPanel(); this.mask = $('#mask');
// this.parent({ // this.parent({
// closeButton:false, // closeButton:false,
// destroyOnClose:true, // destroyOnClose:true,
@ -189,34 +189,52 @@ editor = {};
// }} // }}
// ); // );
// this.setContent(panel); // this.setContent(panel);
// }, },
//
// _buildPanel:function () { _buildPanel:function () {
// var result = new Element('div'); var image = $('<img src="images/ajax-loader.gif">');
// result.setStyles({ image.css('margin-top', '25px');
// 'text-align':'center', var result = $('<div></div>')
// width:'400px' .css({
// }); 'text-align': 'center',
// var img = new Element('img', {'src':'images/ajax-loader.gif'}); 'width': '400px',
// img.setStyle('margin-top', '15px'); 'height': '120px',
// img.inject(result); 'z-index': '9999',
// return result; 'position': 'absolute',
// }, 'background-color': 'white',
// 'border-radius': '4px',
// show:function () { 'border': '1px solid rgb(255, 163, 0)'
// this.open(); });
// },
// result.append(image);
// destroy:function () {
// this.parent(); var winH = $(document).height();
// this.overlay.destroy(); var winW = $(document).width();
// }
// //Set the popup window to center
//}); result.css('top', winH/2 - result.height()/2);
result.css('left', winW/2 - result.width()/2);
return result;
},
show:function () {
//Set height and width to mask to fill up the whole screen
this.mask.css({'width': $(window).width(), 'height': $(window).height()});
this.mask.fadeIn('slow');
this.mask.fadeTo("slow",0.8);
$(document.body).append(this.panel);
this.panel.fadeIn('slow');
},
close: function() {
this.panel.fadeOut('slow');
this.mask.hide();
}
});
// Show loading dialog ... // Show loading dialog ...
//waitDialog = new editor.WaitDialog(); waitDialog = new editor.WaitDialog();
//waitDialog.show(); waitDialog.show();
// Loading libraries ... // Loading libraries ...
jQuery.getScript("js/mindplot-min.js"); jQuery.getScript("js/mindplot-min.js");