Make WordPress Core

Changeset 20677


Ignore:
Timestamp:
05/01/2012 10:50:47 PM (12 years ago)
Author:
azaozz
Message:

Move the check for body.mobile in postbox.js to a variable as it's used in more than one place, props georgestephanis, scribu, fixes #20561

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/js/postbox.dev.js

    r20614 r20677  
    6464
    6565        init : function(page, args) {
     66            var isMobile = $(document.body).hasClass('mobile');
     67
    6668            $.extend( this, args || {} );
    6769            $('#wpbody-content').css('overflow','hidden');
     
    7274                handle: '.hndle',
    7375                cursor: 'move',
    74                 delay: ( $('body').hasClass('mobile') ? 200 : 0 ),
     76                delay: ( isMobile ? 200 : 0 ),
    7577                distance: 2,
    7678                tolerance: 'pointer',
     
    9496            });
    9597
    96             if ( navigator.userAgent.match(/mobile/i) ) {
     98            if ( isMobile ) {
    9799                $(document.body).bind('orientationchange.postboxes', function(){ postboxes._pb_change(); });
    98100                this._pb_change();
Note: See TracChangeset for help on using the changeset viewer.