From 7cc8dd8985bec8796e9e3b5a126d6a512f1134cb Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Tue, 16 Dec 2014 19:43:22 +0000 Subject: [PATCH] Improve the fix for menu shakiness when over-scrolling. Recalculate heights on editor auto-resize. Merges [30852] to the 4.1 branch. See #30692. Built from https://develop.svn.wordpress.org/branches/4.1@30918 git-svn-id: http://core.svn.wordpress.org/branches/4.1@30908 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/js/common.js | 42 ++++++++++++++------------------------- wp-admin/js/common.min.js | 2 +- 2 files changed, 16 insertions(+), 28 deletions(-) diff --git a/wp-admin/js/common.js b/wp-admin/js/common.js index e41c7e8998..01ce8945d4 100644 --- a/wp-admin/js/common.js +++ b/wp-admin/js/common.js @@ -193,11 +193,9 @@ $(document).ready( function() { lastScrollPosition = 0, pinnedMenuTop = false, pinnedMenuBottom = false, - isScrolling = false, - scrollTimer, menuTop = 0, + menuIsPinned = false, height = { - document: $document.height(), window: $window.height(), wpwrap: $wpwrap.height(), adminbar: $adminbar.height(), @@ -544,18 +542,22 @@ $(document).ready( function() { input.on('change', toggleUploadButton); })(); - function pinMenu() { - var windowPos = $window.scrollTop(); + function pinMenu( event ) { + var windowPos = $window.scrollTop(), + resizing = ! event || event.type !== 'scroll'; if ( isIOS || isIE8 || $adminmenu.data( 'wp-responsive' ) ) { return; } - if ( height.menu + height.adminbar + 20 > height.wpwrap ) { // 20px "buffer" + if ( height.menu + height.adminbar < height.window || + height.menu + height.adminbar + 20 > height.wpwrap ) { unpinMenu(); return; } + menuIsPinned = true; + if ( height.menu + height.adminbar > height.window ) { // Check for overscrolling if ( windowPos < 0 ) { @@ -571,7 +573,7 @@ $(document).ready( function() { } return; - } else if ( windowPos + height.window > height.document - 1 ) { + } else if ( windowPos + height.window > $document.height() - 1 ) { if ( ! pinnedMenuBottom ) { pinnedMenuBottom = true; pinnedMenuTop = false; @@ -638,7 +640,7 @@ $(document).ready( function() { bottom: '' }); } - } else { + } else if ( resizing ) { // Resizing pinnedMenuTop = pinnedMenuBottom = false; menuTop = windowPos + height.window - height.menu - height.adminbar - 1; @@ -660,7 +662,6 @@ $(document).ready( function() { function resetHeights() { height = { - document: $document.height(), window: $window.height(), wpwrap: $wpwrap.height(), adminbar: $adminbar.height(), @@ -669,11 +670,11 @@ $(document).ready( function() { } function unpinMenu() { - if ( isIOS ) { + if ( isIOS || ! menuIsPinned ) { return; } - pinnedMenuTop = pinnedMenuBottom = false; + pinnedMenuTop = pinnedMenuBottom = menuIsPinned = false; $adminMenuWrap.css({ position: '', top: '', @@ -696,23 +697,10 @@ $(document).ready( function() { } } - function scrollStart() { - if ( isScrolling ) { - window.clearTimeout( scrollTimer ); - - scrollTimer = window.setTimeout( function() { - isScrolling = false; - }, 200 ); - } else { - isScrolling = true; - $document.triggerHandler( 'wp-scroll-start' ); - } - } - if ( ! isIOS ) { - $window.on( 'scroll.pin-menu', function() { - scrollStart(); - pinMenu(); + $window.on( 'scroll.pin-menu', pinMenu ); + $document.on( 'tinymce-editor-init.pin-menu', function( event, editor ) { + editor.on( 'wp-autoresize', resetHeights ); }); } diff --git a/wp-admin/js/common.min.js b/wp-admin/js/common.min.js index 55eb14b1cc..8e056fc5d2 100644 --- a/wp-admin/js/common.min.js +++ b/wp-admin/js/common.min.js @@ -1 +1 @@ -var showNotice,adminMenu,columns,validateForm,screenMeta;!function(a,b){adminMenu={init:function(){},fold:function(){},restoreMenuState:function(){},toggle:function(){},favorites:function(){}},columns={init:function(){var b=this;a(".hide-column-tog","#adv-settings").click(function(){var c=a(this),d=c.val();c.prop("checked")?b.checked(d):b.unchecked(d),columns.saveManageColumnsState()})},saveManageColumnsState:function(){var b=this.hidden();a.post(ajaxurl,{action:"hidden-columns",hidden:b,screenoptionnonce:a("#screenoptionnonce").val(),page:pagenow})},checked:function(b){a(".column-"+b).show(),this.colSpanChange(1)},unchecked:function(b){a(".column-"+b).hide(),this.colSpanChange(-1)},hidden:function(){return a(".manage-column").filter(":hidden").map(function(){return this.id}).get().join(",")},useCheckboxesForHidden:function(){this.hidden=function(){return a(".hide-column-tog").not(":checked").map(function(){var a=this.id;return a.substring(a,a.length-5)}).get().join(",")}},colSpanChange:function(b){var c,d=a("table").find(".colspanchange");d.length&&(c=parseInt(d.attr("colspan"),10)+b,d.attr("colspan",c.toString()))}},a(document).ready(function(){columns.init()}),validateForm=function(b){return!a(b).find(".form-required").filter(function(){return""===a("input:visible",this).val()}).addClass("form-invalid").find("input:visible").change(function(){a(this).closest(".form-invalid").removeClass("form-invalid")}).size()},showNotice={warn:function(){var a=commonL10n.warnDelete||"";return confirm(a)?!0:!1},note:function(a){alert(a)}},screenMeta={element:null,toggles:null,page:null,init:function(){this.element=a("#screen-meta"),this.toggles=a(".screen-meta-toggle a"),this.page=a("#wpcontent"),this.toggles.click(this.toggleEvent)},toggleEvent:function(b){var c=a(this.href.replace(/.+#/,"#"));b.preventDefault(),c.length&&(c.is(":visible")?screenMeta.close(c,a(this)):screenMeta.open(c,a(this)))},open:function(b,c){a(".screen-meta-toggle").not(c.parent()).css("visibility","hidden"),b.parent().show(),b.slideDown("fast",function(){b.focus(),c.addClass("screen-meta-active").attr("aria-expanded",!0)}),a(document).trigger("screen:options:open")},close:function(b,c){b.slideUp("fast",function(){c.removeClass("screen-meta-active").attr("aria-expanded",!1),a(".screen-meta-toggle").css("visibility",""),b.parent().hide()}),a(document).trigger("screen:options:close")}},a(".contextual-help-tabs").delegate("a","click",function(b){var c,d=a(this);return b.preventDefault(),d.is(".active a")?!1:(a(".contextual-help-tabs .active").removeClass("active"),d.parent("li").addClass("active"),c=a(d.attr("href")),a(".help-tab-content").not(c).removeClass("active").hide(),void c.addClass("active").show())}),a(document).ready(function(){function c(a){var b,c,d,e,f,g,h,i=a.find(".wp-submenu");f=a.offset().top,g=y.scrollTop(),h=f-g-30,b=f+i.height()+1,c=B.height(),d=60+b-c,e=y.height()+g-50,b-d>e&&(d=b-e),d>h&&(d=h),d>1?i.css("margin-top","-"+d+"px"):i.css("margin-top","")}function d(){var a=y.scrollTop();if(!(u||w||C.data("wp-responsive"))){if(O.menu+O.adminbar+20>O.wpwrap)return void f();if(O.menu+O.adminbar>O.window){if(0>a)return void(K||(K=!0,L=!1,A.css({position:"fixed",top:"",bottom:""})));if(a+O.window>O.document-1)return void(L||(L=!0,K=!1,A.css({position:"fixed",top:"",bottom:0})));a>J?K?(K=!1,N=A.offset().top-O.adminbar-(a-J),N+O.menu+O.adminbara?L?(L=!1,N=A.offset().top-O.adminbar+(J-a),N+O.menu>a+O.window&&(N=a),A.css({position:"absolute",top:N,bottom:""})):!K&&A.offset().top>=a+O.adminbar&&(K=!0,A.css({position:"fixed",top:"",bottom:""})):(K=L=!1,N=a+O.window-O.menu-O.adminbar-1,N>0?A.css({position:"absolute",top:N,bottom:""}):f())}J=a}}function e(){O={document:x.height(),window:y.height(),wpwrap:B.height(),adminbar:I.height(),menu:A.height()}}function f(){u||(K=L=!1,A.css({position:"",top:"",bottom:""}))}function g(){e(),C.data("wp-responsive")?(z.removeClass("sticky-menu"),f()):O.menu+O.adminbar>O.window?(d(),z.removeClass("sticky-menu")):(z.addClass("sticky-menu"),f())}function h(){M?(b.clearTimeout(q),q=b.setTimeout(function(){M=!1},200)):(M=!0,x.triggerHandler("wp-scroll-start"))}var i,j,k,l,m,n,o,p,q,r=!1,s=a("input.current-page"),t=s.val(),u=/iPhone|iPad|iPod/.test(navigator.userAgent),v=-1!==navigator.userAgent.indexOf("Android"),w=a(document.documentElement).hasClass("ie8"),x=a(document),y=a(b),z=a(document.body),A=a("#adminmenuwrap"),B=a("#wpwrap"),C=a("#adminmenu"),D=a("#wp-responsive-overlay"),E=a("#wp-toolbar"),F=E.find('a[aria-haspopup="true"]'),G=a(".meta-box-sortables"),H=!1,I=a("#wpadminbar"),J=0,K=!1,L=!1,M=!1,N=0,O={document:x.height(),window:y.height(),wpwrap:B.height(),adminbar:I.height(),menu:A.height()};C.on("click.wp-submenu-head",".wp-submenu-head",function(b){a(b.target).parent().siblings("a").get(0).click()}),a("#collapse-menu").on("click.collapse-menu",function(){var c,d,e=a(document.body);a("#adminmenu div.wp-submenu").css("margin-top",""),c=b.innerWidth?Math.max(b.innerWidth,document.documentElement.clientWidth):961,c&&960>c?e.hasClass("auto-fold")?(e.removeClass("auto-fold").removeClass("folded"),setUserSetting("unfold",1),setUserSetting("mfold","o"),d="open"):(e.addClass("auto-fold"),setUserSetting("unfold",0),d="folded"):e.hasClass("folded")?(e.removeClass("folded"),setUserSetting("mfold","o"),d="open"):(e.addClass("folded"),setUserSetting("mfold","f"),d="folded"),a(document).trigger("wp-collapse-menu",{state:d})}),("ontouchstart"in b||/IEMobile\/[1-9]/.test(navigator.userAgent))&&(n=u?"touchstart":"click",a(document.body).on(n+".wp-mobile-hover",function(b){C.data("wp-responsive")||a(b.target).closest("#adminmenu").length||C.find("li.opensub").removeClass("opensub")}),C.find("a.wp-has-submenu").on(n+".wp-mobile-hover",function(b){var d=a(this).parent();C.data("wp-responsive")||d.hasClass("opensub")||d.hasClass("wp-menu-open")&&!(d.width()<40)||(b.preventDefault(),c(d),C.find("li.opensub").removeClass("opensub"),d.addClass("opensub"))})),u||v||(C.find("li.wp-has-submenu").hoverIntent({over:function(){var b=a(this),d=b.find(".wp-submenu"),e=parseInt(d.css("top"),10);isNaN(e)||e>-5||C.data("wp-responsive")||(c(b),C.find("li.opensub").removeClass("opensub"),b.addClass("opensub"))},out:function(){C.data("wp-responsive")||a(this).removeClass("opensub").find(".wp-submenu").css("margin-top","")},timeout:200,sensitivity:7,interval:90}),C.on("focus.adminmenu",".wp-submenu a",function(b){C.data("wp-responsive")||a(b.target).closest("li.menu-top").addClass("opensub")}).on("blur.adminmenu",".wp-submenu a",function(b){C.data("wp-responsive")||a(b.target).closest("li.menu-top").removeClass("opensub")}).find("li.wp-has-submenu.wp-not-current-submenu").on("focusin.adminmenu",function(){c(a(this))})),a("div.wrap h2:first").nextAll("div.updated, div.error").addClass("below-h2"),a("div.updated, div.error").not(".below-h2, .inline").insertAfter(a("div.wrap h2:first")),screenMeta.init(),a("tbody").children().children(".check-column").find(":checkbox").click(function(b){if("undefined"==b.shiftKey)return!0;if(b.shiftKey){if(!r)return!0;i=a(r).closest("form").find(":checkbox"),j=i.index(r),k=i.index(this),l=a(this).prop("checked"),j>0&&k>0&&j!=k&&(m=k>j?i.slice(j,k):i.slice(k,j),m.prop("checked",function(){return a(this).closest("tr").is(":visible")?l:!1}))}r=this;var c=a(this).closest("tbody").find(":checkbox").filter(":visible").not(":checked");return a(this).closest("table").children("thead, tfoot").find(":checkbox").prop("checked",function(){return 0===c.length}),!0}),a("thead, tfoot").find(".check-column :checkbox").on("click.wp-toggle-checkboxes",function(b){var c=a(this),d=c.closest("table"),e=c.prop("checked"),f=b.shiftKey||c.data("wp-toggle");d.children("tbody").filter(":visible").children().children(".check-column").find(":checkbox").prop("checked",function(){return a(this).is(":hidden")?!1:f?!a(this).prop("checked"):e?!0:!1}),d.children("thead, tfoot").filter(":visible").children().children(".check-column").find(":checkbox").prop("checked",function(){return f?!1:e?!0:!1})}),a("td.post-title, td.title, td.comment, .bookmarks td.column-name, td.blogname, td.username, .dashboard-comment-wrap").focusin(function(){clearTimeout(o),p=a(this).find(".row-actions"),p.addClass("visible")}).focusout(function(){o=setTimeout(function(){p.removeClass("visible")},30)}),a("#default-password-nag-no").click(function(){return setUserSetting("default_password_nag","hide"),a("div.default-password-nag").hide(),!1}),a("#newcontent").bind("keydown.wpevent_InsertTab",function(b){var c,d,e,f,g,h=b.target;if(27==b.keyCode)return void a(h).data("tab-out",!0);if(!(9!=b.keyCode||b.ctrlKey||b.altKey||b.shiftKey)){if(a(h).data("tab-out"))return void a(h).data("tab-out",!1);c=h.selectionStart,d=h.selectionEnd,e=h.value;try{this.lastKey=9}catch(i){}document.selection?(h.focus(),g=document.selection.createRange(),g.text=" "):c>=0&&(f=this.scrollTop,h.value=e.substring(0,c).concat(" ",e.substring(d)),h.selectionStart=h.selectionEnd=c+1,this.scrollTop=f),b.stopPropagation&&b.stopPropagation(),b.preventDefault&&b.preventDefault()}}),a("#newcontent").bind("blur.wpevent_InsertTab",function(){this.lastKey&&9==this.lastKey&&this.focus()}),s.length&&s.closest("form").submit(function(){-1==a('select[name="action"]').val()&&-1==a('select[name="action2"]').val()&&s.val()==t&&s.val("1")}),a('.search-box input[type="search"], .search-box input[type="submit"]').mousedown(function(){a('select[name^="action"]').val("-1")}),a("#contextual-help-link, #show-settings-link").on("focus.scroll-into-view",function(a){a.target.scrollIntoView&&a.target.scrollIntoView(!1)}),function(){function b(){c.prop("disabled",""===d.map(function(){return a(this).val()}).get().join(""))}var c,d,e=a("form.wp-upload-form");e.length&&(c=e.find('input[type="submit"]'),d=e.find('input[type="file"]'),b(),d.on("change",b))}(),u||y.on("scroll.pin-menu",function(){h(),d()}),b.wpResponsive={init:function(){var c=this;x.on("wp-responsive-activate.wp-responsive",function(){c.activate()}).on("wp-responsive-deactivate.wp-responsive",function(){c.deactivate()}),a("#wp-admin-bar-menu-toggle a").attr("aria-expanded","false"),a("#wp-admin-bar-menu-toggle").on("click.wp-responsive",function(b){b.preventDefault(),B.toggleClass("wp-responsive-open"),B.hasClass("wp-responsive-open")?(a(this).find("a").attr("aria-expanded","true"),a("#adminmenu a:first").focus()):a(this).find("a").attr("aria-expanded","false")}),C.on("click.wp-responsive","li.wp-has-submenu > a",function(b){C.data("wp-responsive")&&(a(this).parent("li").toggleClass("selected"),b.preventDefault())}),c.trigger(),x.on("wp-window-resized.wp-responsive",a.proxy(this.trigger,this)),y.on("load.wp-responsive",function(){var a=navigator.userAgent.indexOf("AppleWebKit/")>-1?y.width():b.innerWidth;782>=a&&c.disableSortables()})},activate:function(){g(),z.hasClass("auto-fold")||z.addClass("auto-fold"),C.data("wp-responsive",1),this.disableSortables()},deactivate:function(){g(),C.removeData("wp-responsive"),this.enableSortables()},trigger:function(){var a;b.innerWidth&&(a=Math.max(b.innerWidth,document.documentElement.clientWidth),782>=a?H||(x.trigger("wp-responsive-activate"),H=!0):H&&(x.trigger("wp-responsive-deactivate"),H=!1),480>=a?this.enableOverlay():this.disableOverlay())},enableOverlay:function(){0===D.length&&(D=a('
').insertAfter("#wpcontent").hide().on("click.wp-responsive",function(){E.find(".menupop.hover").removeClass("hover"),a(this).hide()})),F.on("click.wp-responsive",function(){D.show()})},disableOverlay:function(){F.off("click.wp-responsive"),D.hide()},disableSortables:function(){if(G.length)try{G.sortable("disable")}catch(a){}},enableSortables:function(){if(G.length)try{G.sortable("enable")}catch(a){}}},b.wpResponsive.init(),g(),x.on("wp-window-resized.pin-menu postboxes-columnchange.pin-menu postbox-toggled.pin-menu wp-collapse-menu.pin-menu wp-scroll-start.pin-menu",g)}),function(){function c(){a(document).trigger("wp-window-resized")}function d(){b.clearTimeout(e),e=b.setTimeout(c,200)}var e;a(b).on("resize.wp-fire-once",d)}(),function(){if("-ms-user-select"in document.documentElement.style&&navigator.userAgent.match(/IEMobile\/10\.0/)){var a=document.createElement("style");a.appendChild(document.createTextNode("@-ms-viewport{width:auto!important}")),document.getElementsByTagName("head")[0].appendChild(a)}}()}(jQuery,window); \ No newline at end of file +var showNotice,adminMenu,columns,validateForm,screenMeta;!function(a,b){adminMenu={init:function(){},fold:function(){},restoreMenuState:function(){},toggle:function(){},favorites:function(){}},columns={init:function(){var b=this;a(".hide-column-tog","#adv-settings").click(function(){var c=a(this),d=c.val();c.prop("checked")?b.checked(d):b.unchecked(d),columns.saveManageColumnsState()})},saveManageColumnsState:function(){var b=this.hidden();a.post(ajaxurl,{action:"hidden-columns",hidden:b,screenoptionnonce:a("#screenoptionnonce").val(),page:pagenow})},checked:function(b){a(".column-"+b).show(),this.colSpanChange(1)},unchecked:function(b){a(".column-"+b).hide(),this.colSpanChange(-1)},hidden:function(){return a(".manage-column").filter(":hidden").map(function(){return this.id}).get().join(",")},useCheckboxesForHidden:function(){this.hidden=function(){return a(".hide-column-tog").not(":checked").map(function(){var a=this.id;return a.substring(a,a.length-5)}).get().join(",")}},colSpanChange:function(b){var c,d=a("table").find(".colspanchange");d.length&&(c=parseInt(d.attr("colspan"),10)+b,d.attr("colspan",c.toString()))}},a(document).ready(function(){columns.init()}),validateForm=function(b){return!a(b).find(".form-required").filter(function(){return""===a("input:visible",this).val()}).addClass("form-invalid").find("input:visible").change(function(){a(this).closest(".form-invalid").removeClass("form-invalid")}).size()},showNotice={warn:function(){var a=commonL10n.warnDelete||"";return confirm(a)?!0:!1},note:function(a){alert(a)}},screenMeta={element:null,toggles:null,page:null,init:function(){this.element=a("#screen-meta"),this.toggles=a(".screen-meta-toggle a"),this.page=a("#wpcontent"),this.toggles.click(this.toggleEvent)},toggleEvent:function(b){var c=a(this.href.replace(/.+#/,"#"));b.preventDefault(),c.length&&(c.is(":visible")?screenMeta.close(c,a(this)):screenMeta.open(c,a(this)))},open:function(b,c){a(".screen-meta-toggle").not(c.parent()).css("visibility","hidden"),b.parent().show(),b.slideDown("fast",function(){b.focus(),c.addClass("screen-meta-active").attr("aria-expanded",!0)}),a(document).trigger("screen:options:open")},close:function(b,c){b.slideUp("fast",function(){c.removeClass("screen-meta-active").attr("aria-expanded",!1),a(".screen-meta-toggle").css("visibility",""),b.parent().hide()}),a(document).trigger("screen:options:close")}},a(".contextual-help-tabs").delegate("a","click",function(b){var c,d=a(this);return b.preventDefault(),d.is(".active a")?!1:(a(".contextual-help-tabs .active").removeClass("active"),d.parent("li").addClass("active"),c=a(d.attr("href")),a(".help-tab-content").not(c).removeClass("active").hide(),void c.addClass("active").show())}),a(document).ready(function(){function c(a){var b,c,d,e,f,g,h,i=a.find(".wp-submenu");f=a.offset().top,g=w.scrollTop(),h=f-g-30,b=f+i.height()+1,c=z.height(),d=60+b-c,e=w.height()+g-50,b-d>e&&(d=b-e),d>h&&(d=h),d>1?i.css("margin-top","-"+d+"px"):i.css("margin-top","")}function d(a){var b=w.scrollTop(),c=!a||"scroll"!==a.type;if(!(s||u||A.data("wp-responsive"))){if(M.menu+M.adminbarM.wpwrap)return void f();if(L=!0,M.menu+M.adminbar>M.window){if(0>b)return void(I||(I=!0,J=!1,y.css({position:"fixed",top:"",bottom:""})));if(b+M.window>v.height()-1)return void(J||(J=!0,I=!1,y.css({position:"fixed",top:"",bottom:0})));b>H?I?(I=!1,K=y.offset().top-M.adminbar-(b-H),K+M.menu+M.adminbarb?J?(J=!1,K=y.offset().top-M.adminbar+(H-b),K+M.menu>b+M.window&&(K=b),y.css({position:"absolute",top:K,bottom:""})):!I&&y.offset().top>=b+M.adminbar&&(I=!0,y.css({position:"fixed",top:"",bottom:""})):c&&(I=J=!1,K=b+M.window-M.menu-M.adminbar-1,K>0?y.css({position:"absolute",top:K,bottom:""}):f())}H=b}}function e(){M={window:w.height(),wpwrap:z.height(),adminbar:G.height(),menu:y.height()}}function f(){!s&&L&&(I=J=L=!1,y.css({position:"",top:"",bottom:""}))}function g(){e(),A.data("wp-responsive")?(x.removeClass("sticky-menu"),f()):M.menu+M.adminbar>M.window?(d(),x.removeClass("sticky-menu")):(x.addClass("sticky-menu"),f())}var h,i,j,k,l,m,n,o,p=!1,q=a("input.current-page"),r=q.val(),s=/iPhone|iPad|iPod/.test(navigator.userAgent),t=-1!==navigator.userAgent.indexOf("Android"),u=a(document.documentElement).hasClass("ie8"),v=a(document),w=a(b),x=a(document.body),y=a("#adminmenuwrap"),z=a("#wpwrap"),A=a("#adminmenu"),B=a("#wp-responsive-overlay"),C=a("#wp-toolbar"),D=C.find('a[aria-haspopup="true"]'),E=a(".meta-box-sortables"),F=!1,G=a("#wpadminbar"),H=0,I=!1,J=!1,K=0,L=!1,M={window:w.height(),wpwrap:z.height(),adminbar:G.height(),menu:y.height()};A.on("click.wp-submenu-head",".wp-submenu-head",function(b){a(b.target).parent().siblings("a").get(0).click()}),a("#collapse-menu").on("click.collapse-menu",function(){var c,d,e=a(document.body);a("#adminmenu div.wp-submenu").css("margin-top",""),c=b.innerWidth?Math.max(b.innerWidth,document.documentElement.clientWidth):961,c&&960>c?e.hasClass("auto-fold")?(e.removeClass("auto-fold").removeClass("folded"),setUserSetting("unfold",1),setUserSetting("mfold","o"),d="open"):(e.addClass("auto-fold"),setUserSetting("unfold",0),d="folded"):e.hasClass("folded")?(e.removeClass("folded"),setUserSetting("mfold","o"),d="open"):(e.addClass("folded"),setUserSetting("mfold","f"),d="folded"),a(document).trigger("wp-collapse-menu",{state:d})}),("ontouchstart"in b||/IEMobile\/[1-9]/.test(navigator.userAgent))&&(m=s?"touchstart":"click",a(document.body).on(m+".wp-mobile-hover",function(b){A.data("wp-responsive")||a(b.target).closest("#adminmenu").length||A.find("li.opensub").removeClass("opensub")}),A.find("a.wp-has-submenu").on(m+".wp-mobile-hover",function(b){var d=a(this).parent();A.data("wp-responsive")||d.hasClass("opensub")||d.hasClass("wp-menu-open")&&!(d.width()<40)||(b.preventDefault(),c(d),A.find("li.opensub").removeClass("opensub"),d.addClass("opensub"))})),s||t||(A.find("li.wp-has-submenu").hoverIntent({over:function(){var b=a(this),d=b.find(".wp-submenu"),e=parseInt(d.css("top"),10);isNaN(e)||e>-5||A.data("wp-responsive")||(c(b),A.find("li.opensub").removeClass("opensub"),b.addClass("opensub"))},out:function(){A.data("wp-responsive")||a(this).removeClass("opensub").find(".wp-submenu").css("margin-top","")},timeout:200,sensitivity:7,interval:90}),A.on("focus.adminmenu",".wp-submenu a",function(b){A.data("wp-responsive")||a(b.target).closest("li.menu-top").addClass("opensub")}).on("blur.adminmenu",".wp-submenu a",function(b){A.data("wp-responsive")||a(b.target).closest("li.menu-top").removeClass("opensub")}).find("li.wp-has-submenu.wp-not-current-submenu").on("focusin.adminmenu",function(){c(a(this))})),a("div.wrap h2:first").nextAll("div.updated, div.error").addClass("below-h2"),a("div.updated, div.error").not(".below-h2, .inline").insertAfter(a("div.wrap h2:first")),screenMeta.init(),a("tbody").children().children(".check-column").find(":checkbox").click(function(b){if("undefined"==b.shiftKey)return!0;if(b.shiftKey){if(!p)return!0;h=a(p).closest("form").find(":checkbox"),i=h.index(p),j=h.index(this),k=a(this).prop("checked"),i>0&&j>0&&i!=j&&(l=j>i?h.slice(i,j):h.slice(j,i),l.prop("checked",function(){return a(this).closest("tr").is(":visible")?k:!1}))}p=this;var c=a(this).closest("tbody").find(":checkbox").filter(":visible").not(":checked");return a(this).closest("table").children("thead, tfoot").find(":checkbox").prop("checked",function(){return 0===c.length}),!0}),a("thead, tfoot").find(".check-column :checkbox").on("click.wp-toggle-checkboxes",function(b){var c=a(this),d=c.closest("table"),e=c.prop("checked"),f=b.shiftKey||c.data("wp-toggle");d.children("tbody").filter(":visible").children().children(".check-column").find(":checkbox").prop("checked",function(){return a(this).is(":hidden")?!1:f?!a(this).prop("checked"):e?!0:!1}),d.children("thead, tfoot").filter(":visible").children().children(".check-column").find(":checkbox").prop("checked",function(){return f?!1:e?!0:!1})}),a("td.post-title, td.title, td.comment, .bookmarks td.column-name, td.blogname, td.username, .dashboard-comment-wrap").focusin(function(){clearTimeout(n),o=a(this).find(".row-actions"),o.addClass("visible")}).focusout(function(){n=setTimeout(function(){o.removeClass("visible")},30)}),a("#default-password-nag-no").click(function(){return setUserSetting("default_password_nag","hide"),a("div.default-password-nag").hide(),!1}),a("#newcontent").bind("keydown.wpevent_InsertTab",function(b){var c,d,e,f,g,h=b.target;if(27==b.keyCode)return void a(h).data("tab-out",!0);if(!(9!=b.keyCode||b.ctrlKey||b.altKey||b.shiftKey)){if(a(h).data("tab-out"))return void a(h).data("tab-out",!1);c=h.selectionStart,d=h.selectionEnd,e=h.value;try{this.lastKey=9}catch(i){}document.selection?(h.focus(),g=document.selection.createRange(),g.text=" "):c>=0&&(f=this.scrollTop,h.value=e.substring(0,c).concat(" ",e.substring(d)),h.selectionStart=h.selectionEnd=c+1,this.scrollTop=f),b.stopPropagation&&b.stopPropagation(),b.preventDefault&&b.preventDefault()}}),a("#newcontent").bind("blur.wpevent_InsertTab",function(){this.lastKey&&9==this.lastKey&&this.focus()}),q.length&&q.closest("form").submit(function(){-1==a('select[name="action"]').val()&&-1==a('select[name="action2"]').val()&&q.val()==r&&q.val("1")}),a('.search-box input[type="search"], .search-box input[type="submit"]').mousedown(function(){a('select[name^="action"]').val("-1")}),a("#contextual-help-link, #show-settings-link").on("focus.scroll-into-view",function(a){a.target.scrollIntoView&&a.target.scrollIntoView(!1)}),function(){function b(){c.prop("disabled",""===d.map(function(){return a(this).val()}).get().join(""))}var c,d,e=a("form.wp-upload-form");e.length&&(c=e.find('input[type="submit"]'),d=e.find('input[type="file"]'),b(),d.on("change",b))}(),s||(w.on("scroll.pin-menu",d),v.on("tinymce-editor-init.pin-menu",function(a,b){b.on("wp-autoresize",e)})),b.wpResponsive={init:function(){var c=this;v.on("wp-responsive-activate.wp-responsive",function(){c.activate()}).on("wp-responsive-deactivate.wp-responsive",function(){c.deactivate()}),a("#wp-admin-bar-menu-toggle a").attr("aria-expanded","false"),a("#wp-admin-bar-menu-toggle").on("click.wp-responsive",function(b){b.preventDefault(),z.toggleClass("wp-responsive-open"),z.hasClass("wp-responsive-open")?(a(this).find("a").attr("aria-expanded","true"),a("#adminmenu a:first").focus()):a(this).find("a").attr("aria-expanded","false")}),A.on("click.wp-responsive","li.wp-has-submenu > a",function(b){A.data("wp-responsive")&&(a(this).parent("li").toggleClass("selected"),b.preventDefault())}),c.trigger(),v.on("wp-window-resized.wp-responsive",a.proxy(this.trigger,this)),w.on("load.wp-responsive",function(){var a=navigator.userAgent.indexOf("AppleWebKit/")>-1?w.width():b.innerWidth;782>=a&&c.disableSortables()})},activate:function(){g(),x.hasClass("auto-fold")||x.addClass("auto-fold"),A.data("wp-responsive",1),this.disableSortables()},deactivate:function(){g(),A.removeData("wp-responsive"),this.enableSortables()},trigger:function(){var a;b.innerWidth&&(a=Math.max(b.innerWidth,document.documentElement.clientWidth),782>=a?F||(v.trigger("wp-responsive-activate"),F=!0):F&&(v.trigger("wp-responsive-deactivate"),F=!1),480>=a?this.enableOverlay():this.disableOverlay())},enableOverlay:function(){0===B.length&&(B=a('
').insertAfter("#wpcontent").hide().on("click.wp-responsive",function(){C.find(".menupop.hover").removeClass("hover"),a(this).hide()})),D.on("click.wp-responsive",function(){B.show()})},disableOverlay:function(){D.off("click.wp-responsive"),B.hide()},disableSortables:function(){if(E.length)try{E.sortable("disable")}catch(a){}},enableSortables:function(){if(E.length)try{E.sortable("enable")}catch(a){}}},b.wpResponsive.init(),g(),v.on("wp-window-resized.pin-menu postboxes-columnchange.pin-menu postbox-toggled.pin-menu wp-collapse-menu.pin-menu wp-scroll-start.pin-menu",g)}),function(){function c(){a(document).trigger("wp-window-resized")}function d(){b.clearTimeout(e),e=b.setTimeout(c,200)}var e;a(b).on("resize.wp-fire-once",d)}(),function(){if("-ms-user-select"in document.documentElement.style&&navigator.userAgent.match(/IEMobile\/10\.0/)){var a=document.createElement("style");a.appendChild(document.createTextNode("@-ms-viewport{width:auto!important}")),document.getElementsByTagName("head")[0].appendChild(a)}}()}(jQuery,window); \ No newline at end of file