Commit f100c8ba authored by Rene AJM Veerman's avatar Rene AJM Veerman

made the startup routine slightly more efficient

parent 855a0730
......@@ -294,6 +294,7 @@ sa.siteManager.ui.tree = sa.sm.ui.t = sa.tree = sa.t = {
switchView : function (node, view, event) {
debugger;
if (!event || event.srcElement /* true html mouse event, not triggered from code with jquery */) {
sa.tree.settings.current.view = view;
switch (view) {
case 'all' :
sa.data_models.saMediaAlbum.html.albumView (
......@@ -331,7 +332,9 @@ sa.siteManager.ui.tree = sa.sm.ui.t = sa.tree = sa.t = {
}
setTimeout (function () {
sa.siteManager.ui.resize();
sa.siteManager.ui.clickSiteManagerButtonOnOff (jQuery('#btnView_'+view)[0]);
//jQuery('#btnView_'+view).trigger ('click'); // this is why the event parameter is checked.
}, 200);
......
......@@ -133,6 +133,7 @@ sa.siteManager = sa.sm = {
height : sa.m.browserHeight() - jQuery('#siteMenu')[0].offsetTop - jQuery('#siteMenu')[0].offsetHeight - 40
};
debugger;
jQuery('#siteManager__dialog').animate (animateTo, {
progress : function () {
sa.vcc.applyTheme ('siteManager');
......@@ -141,7 +142,14 @@ sa.siteManager = sa.sm = {
height : jQuery('#siteManager__td__treeview').height()
});
},
done : function () {
done : sa.sm.ui.resize_done,
fail : sa.sm.ui.resize_done
});
},
resize_done : function () {
debugger;
sa.vcc.applyTheme ('siteManager');
jQuery('#siteManager__treeview__background').css({
width : jQuery('#siteManager__td__treeview').width(),
......@@ -162,6 +170,7 @@ sa.siteManager = sa.sm = {
setTimeout (function () {
switch (sa.tree.settings.current.view) {
case 'jQueryFileUpload':
debugger;
jQuery('.siteManager__uploader__tab, #jQueryFileUpload__scrollpane__container, #jQueryFileUpload__scrollpane, #jQueryFileUpload').css({
width : jQuery('#siteManager__uploader_tab').width(),
height : jQuery('#siteManager__uploader_tab').height() - jQuery('#siteManager__tr__uploader_header').height()
......@@ -173,9 +182,6 @@ sa.siteManager = sa.sm = {
break;
};
}, 100);
}
});
}
}
};
......
......@@ -2333,7 +2333,9 @@ sa.statusbar = sa.sb = {
jQuerys.fadeOut('fast', function () {
//sa.m.log (1, 'sa.statusbar.update() : '+msg2);
jQuerys.html(msg2).css({fontSize:fontSize,fontWeight:'bold'});
jQuerys.fadeIn('normal');
jQuerys.clearQueue().fadeIn('normal', function () {
jQuery(this).clearQueue();
});
delete sa.vcc.settings['btnDismiss_siteStatus'];
clearTimeout (sa.sb.settings.current.vccInitTimeout);
sa.sb.settings.current.vccInitTimeout = setTimeout (function () {
......@@ -2403,6 +2405,9 @@ sa.statusbar = sa.sb = {
//sa.vcc.applyTheme ('siteStatus');
var that = jQuery(this);
that.dequeue();
});
}, 50);
......
......@@ -41,7 +41,10 @@ seductiveapps.desktop = {
systemDialogs : {
resize : function (settings) {
if (jQuery('#siteManager__dialog')[0] && sa.s.c.settings.current.visible['#siteManager']) {
if (
(settings && settings.id && settings.id === 'siteManager__dialog')
|| (jQuery('#siteManager__dialog')[0] && sa.s.c.settings.current.visible['#siteManager'])
){
sa.siteManager.ui.resize();
}
},
......@@ -498,7 +501,7 @@ seductiveapps.desktop = {
dialogJqueryID : forDialog
});
}
sa.desktop.systemDialogs.resize();
sa.desktop.systemDialogs.resize(dialog);
if (typeof callback=='function') callback(forDialog, jQueryDialog, html, css, cssOverrides);
}
});
......@@ -992,7 +995,7 @@ seductiveapps.desktop = {
//sa.desktop.morphTo_animationOfElementDone (el, settings, r);
clearTimeout (settings.whenDone2);
jQuery(el).stop().animate (r[id], { // .stop() before .animate() gave problems 20170716 (jQuery-2.1.1), but is FIXED in jQuery 3.2.1 ! :)
jQuery(el).stop().clearQueue().animate (r[id], { // .stop() before .animate() gave problems 20170716 (jQuery-2.1.1), but is FIXED in jQuery 3.2.1 ! :)
duration : settings.animationTime,
easing : sa.m.jQueryEasing(settings.easing),
s : {
......@@ -1005,10 +1008,16 @@ seductiveapps.desktop = {
sa.desktop.morphTo_resizeEl (el, true);
//sa.desktop.morphTo_animationOfElementDone (el, settings, r, false);
//}, 100);
var that = jQuery(this);
that.clearQueue();
},
complete : sa.m.traceFunction(function () {
complete : function () {
/*console.log('t334', 'start0');*/
var that = jQuery(this);
that.clearQueue();
var el = this;
sa.desktop.morphTo_resizeEl (el, true); // calls vividDialog.onresize()
//if (el.id=='siteContent__dialog') debugger;
......@@ -1018,7 +1027,9 @@ seductiveapps.desktop = {
sa.desktop.removeElFromStillAnimatingList (el, settings, r);
//}, 100);
})
}
});
......
......@@ -826,7 +826,7 @@ sa.s.c = sa.site.code = {
},
function () {
sa.desktop.systemDialogs.resize();
//sa.desktop.systemDialogs.resize(); // this is not needed here
// load more or less menu items based on browser width and other stuff
......@@ -1004,8 +1004,10 @@ sa.s.c = sa.site.code = {
setTimeout (sa.m.traceFunction(
function() {
jQuery(sa.s.c.settings.loaderIcon).fadeOut('slow', function() {
jQuery(sa.s.c.settings.loaderIcon).fadeOut('fast', function() {
jQuery(sa.s.c.settings.loaderIcon).remove();
var that = jQuery(this);
that.clearQueue();
});
......@@ -1062,12 +1064,12 @@ sa.s.c = sa.site.code = {
sa.desktop.settings.animating = true;
setTimeout (function() {
//setTimeout (function() {
//sa.desktop.positionForStartup({applyDesiredDesktopConfiguration:false,resizeContents:false});
//sa.s.c.onresize();
setTimeout(function(){
//setTimeout(function(){
var
IDs = sa.s.c.visibleDialogs();
......@@ -1172,8 +1174,8 @@ sa.s.c = sa.site.code = {
if (el.style.display!=='none') sa.desktop.morphTo_resizeEl (el);
});*/
})});
}, 300); // was 750, but 100 works too
}, 300); // was 2000, but 100 works too
//}, 300); // was 750, but 100 works too
//}, 300); // was 2000, but 100 works too
sa.m.waitForCondition ('sa.desktop.settings.animating === false;', function () {
......@@ -1188,7 +1190,7 @@ sa.s.c = sa.site.code = {
sa.statusbar.update ('SeductiveApps.com is now initialized.');
jQuery('.saAd').animate({opacity:1});
//jQuery('.saAd').animate({opacity:1});
var
IDs = sa.s.c.visibleDialogs();
var aids = IDs.inner.replace(/,/g, '__scrollpane,') + '__scrollpane';
......@@ -1281,14 +1283,13 @@ sa.s.c = sa.site.code = {
data = sa.s.c.resizeAds(data);
jQuery('#siteAds__content').html(data);
jQuery('.saAd').animate({opacity:1},700);
jQuery('.saAd').css({opacity:1});
jQuery('#siteAds').css ({
height : jQuery('#siteAds__contentDimensions').height()
});
sa.s.c.selectWhichAdsToShowBasedOnScreenSize(jQuery('#siteAds__dialog'));
//if (jQuery('saAbsoluteDiv').length>=1) jQuery('#siteAds').css({height:jQuery('#siteAds__dialog').height()-30});
jQuery('.saAd').animate({opacity:1});
if (jQuery('.saAd').length>=1) {
jQuery('#siteAds').css ({width:jQuery(jQuery('.saAd')[0]).width()});
jQuery('#siteAds__dialog').css ({width:jQuery(jQuery('.saAd')[0]).width()});
......@@ -2685,7 +2686,7 @@ sa.s.c = sa.site.code = {
//}
if (e.visible) {
if (sa.m.settings.initialized.site) {
jQuery(e.element).css({display:'block',visibility:'visible'}).animate({opacity:1},700);
jQuery(e.element).css({display:'block',visibility:'visible', opacity:1});
jQuery(e.element+'__dialog').css({display:'block',opacity:1,visibility:'visible'});
} else {
jQuery(e.element).css({display:'block',visibility:'visible',opacity:0.00001});
......@@ -2698,7 +2699,7 @@ sa.s.c = sa.site.code = {
jQuery('.vividMenu', e.element).css ({
display : e.visible ? 'block' : 'none'
});
sa.s.c.updateMenu (e.element);
if (jQuery('.vividMenu', e.element).length>0) sa.s.c.updateMenu (e.element);
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment