Make WordPress Core

Changeset 35418


Ignore:
Timestamp:
10/28/2015 06:18:42 PM (9 years ago)
Author:
wonderboymusic
Message:

Thickbox: spinner should disappear when loading is done.

Props niklasbr, afercia.
Fixes #33311.

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/css/common.css

    r35414 r35418  
    26952695body.update-core-php #TB_window,
    26962696body.index-php #TB_window {
    2697     background: #fcfcfc url( ../images/spinner.gif ) no-repeat center;
     2697    background: #fcfcfc;
     2698}
     2699
     2700/* IE 8 needs a change in the pseudo element content */
     2701.ie8 body.plugin-install-php #TB_window:before,
     2702.ie8 body.import-php #TB_window:before,
     2703.ie8 body.plugins-php #TB_window:before,
     2704.ie8 body.update-core-php #TB_window:before,
     2705.ie8 body.index-php #TB_window:before {
     2706    content: " ";
     2707    background: none;
     2708}
     2709
     2710body.plugin-install-php #TB_window.thickbox-loading:before,
     2711body.import-php #TB_window.thickbox-loading:before,
     2712body.plugins-php #TB_window.thickbox-loading:before,
     2713body.update-core-php #TB_window.thickbox-loading:before,
     2714body.index-php #TB_window.thickbox-loading:before {
     2715    content: "";
     2716    display: block;
     2717    width: 20px;
     2718    height: 20px;
     2719    position: absolute;
     2720    left: 50%;
     2721    top: 50%;
     2722    z-index: -1;
     2723    margin: -10px 0 0 -10px;
     2724    background: #fcfcfc url(../images/spinner.gif) no-repeat center;
     2725    -webkit-background-size: 20px 20px;
     2726    background-size: 20px 20px;
     2727    -webkit-transform: translateZ(0);
     2728    transform: translateZ(0);
    26982729}
    26992730
     
    27022733    (min-resolution: 120dpi) {
    27032734
    2704     body.plugin-install-php #TB_window,
    2705     body.import-php #TB_window,
    2706     body.plugins-php #TB_window,
    2707     body.update-core-php #TB_window,
    2708     body.index-php #TB_window {
    2709         background: #fcfcfc url( ../images/spinner-2x.gif ) no-repeat center;
    2710         -webkit-background-size: 20px 20px;
    2711         background-size: 20px 20px;
     2735    body.plugin-install-php #TB_window.thickbox-loading:before,
     2736    body.import-php #TB_window.thickbox-loading:before,
     2737    body.plugins-php #TB_window.thickbox-loading:before,
     2738    body.update-core-php #TB_window.thickbox-loading:before,
     2739    body.index-php #TB_window.thickbox-loading:before {
     2740        background: #fcfcfc url(../images/spinner-2x.gif) no-repeat center;
    27122741    }
    27132742}
  • trunk/src/wp-includes/js/thickbox/thickbox.css

    r34011 r35418  
    1313#TB_window {
    1414    position: fixed;
    15     background: #fff;
     15    background-color: #fff;
    1616    z-index: 100050; /* Above DFW. */
    1717    visibility: hidden;
     
    5656    font-weight: 600;
    5757    line-height: 29px;
    58     overflow: hidden; 
     58    overflow: hidden;
    5959    padding: 0 29px 0 10px;
    6060    text-overflow: ellipsis;
  • trunk/src/wp-includes/js/thickbox/thickbox.js

    r32503 r35418  
    1919});
    2020
    21 //add thickbox to href & area elements that have a class of .thickbox
     21/*
     22 * Add thickbox to href & area elements that have a class of .thickbox.
     23 * Remove the loading indicator when content in an iframe has loaded.
     24 */
    2225function tb_init(domChunk){
    23     jQuery('body').on('click', domChunk, tb_click);
     26    jQuery( 'body' )
     27        .on( 'click', domChunk, tb_click )
     28        .on( 'thickbox:iframe:loaded', function() {
     29            jQuery( '#TB_window' ).removeClass( 'thickbox-loading' );
     30        });
    2431}
    2532
     
    4047            jQuery("html").css("overflow","hidden");
    4148            if (document.getElementById("TB_HideSelect") === null) {//iframe to hide select elements in ie6
    42                 jQuery("body").append("<iframe id='TB_HideSelect'>"+thickboxL10n.noiframes+"</iframe><div id='TB_overlay'></div><div id='TB_window'></div>");
     49                jQuery("body").append("<iframe id='TB_HideSelect'>"+thickboxL10n.noiframes+"</iframe><div id='TB_overlay'></div><div id='TB_window' class='thickbox-loading'></div>");
    4350                jQuery("#TB_overlay").click(tb_remove);
    4451            }
    4552        }else{//all others
    4653            if(document.getElementById("TB_overlay") === null){
    47                 jQuery("body").append("<div id='TB_overlay'></div><div id='TB_window'></div>");
     54                jQuery("body").append("<div id='TB_overlay'></div><div id='TB_window' class='thickbox-loading'></div>");
    4855                jQuery("#TB_overlay").click(tb_remove);
    4956                jQuery( 'body' ).addClass( 'modal-open' );
     
    196203                    jQuery("#TB_iframeContent").remove();
    197204                    if(params['modal'] != "true"){//iframe no modal
    198                         jQuery("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton'><span class='screen-reader-text'>"+thickboxL10n.close+"</span><div class='tb-close-icon'></div></a></div></div><iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;' >"+thickboxL10n.noiframes+"</iframe>");
     205                        jQuery("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton'><span class='screen-reader-text'>"+thickboxL10n.close+"</span><div class='tb-close-icon'></div></a></div></div><iframe frameborder='0' hspace='0' allowTransparency='true' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;' >"+thickboxL10n.noiframes+"</iframe>");
    199206                    }else{//iframe modal
    200207                    jQuery("#TB_overlay").unbind();
    201                         jQuery("#TB_window").append("<iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;'>"+thickboxL10n.noiframes+"</iframe>");
     208                        jQuery("#TB_window").append("<iframe frameborder='0' hspace='0' allowTransparency='true' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;'>"+thickboxL10n.noiframes+"</iframe>");
    202209                    }
    203210            }else{// not an iframe, ajax
     
    261268function tb_showIframe(){
    262269    jQuery("#TB_load").remove();
    263     jQuery("#TB_window").css({'visibility':'visible'});
     270    jQuery("#TB_window").css({'visibility':'visible'}).trigger( 'thickbox:iframe:loaded' );
    264271}
    265272
Note: See TracChangeset for help on using the changeset viewer.