Ticket #20557: quicker-method.diff

File quicker-method.diff, 805 bytes (added by georgestephanis, 13 months ago)

tweaked the last patch for speed, and modified another ifcheck to use the body class (which has much more logic thrown into it in the back-end than just checking the UA string)

  • wp-admin/js/postbox.dev.js

     
    7171                                items: '.postbox', 
    7272                                handle: '.hndle', 
    7373                                cursor: 'move', 
    74                                 delay: ( $('body').hasClass('mobile') ? 200 : 0 ), 
     74                                delay: ( document.getElementsByTagName('body')[0].className.match(/mobile/i) ? 200 : 0 ), 
    7575                                distance: 2, 
    7676                                tolerance: 'pointer', 
    7777                                forcePlaceholderSize: true, 
     
    9393                                } 
    9494                        }); 
    9595 
    96                         if ( navigator.userAgent.match(/mobile/i) ) { 
     96                        if ( document.getElementsByTagName('body')[0].className.match(/mobile/i) ) { 
    9797                                $(document.body).bind('orientationchange.postboxes', function(){ postboxes._pb_change(); }); 
    9898                                this._pb_change(); 
    9999                        }