Ticket #21273: ticket.21273.3.diff
| File ticket.21273.3.diff, 1.5 KB (added by ptahdunbar, 11 months ago) |
|---|
-
wp-admin/js/common.dev.js
131 131 $('.screen-meta-toggle').css('visibility', ''); 132 132 panel.parent().hide(); 133 133 }); 134 135 screenMeta.updateHash(); 136 }, 137 138 updateHash: function( hash ) { 139 hash = hash || ''; 140 window.location.hash = hash; 134 141 } 135 142 }; 136 143 137 144 /** 138 145 * Help tabs. 139 146 */ 147 $(document).ready(function(){ 148 var panel = window.location.hash; 149 150 if ( panel && $(panel).length ) { 151 link = $('a[href='+ panel +']'), panel = $( panel ); 152 153 // Active the correct panel. 154 $('.contextual-help-tabs .active').removeClass('active'); 155 link.parent('li').addClass('active'); 156 $('.help-tab-content').not( panel ).removeClass('active').hide(); 157 panel.addClass('active').show(); 158 159 // Scroll back to the top. 160 $('html, body').animate({ scrollTop: 0 }, 'fast'); 161 162 // Open the help panel. 163 if ( $('#contextual-help-wrap').is(':visible') ) 164 screenMeta.close( $('#contextual-help-wrap'), $('#contextual-help-link') ); 165 else 166 screenMeta.open( $('#contextual-help-wrap'), $('#contextual-help-link') ); 167 }; 168 }); 169 140 170 $('.contextual-help-tabs').delegate('a', 'click focus', function(e) { 141 171 var link = $(this), 142 172 panel; … … 153 183 154 184 panel = $( link.attr('href') ); 155 185 186 screenMeta.updateHash( $(panel).attr('id') ); 187 156 188 // Panels 157 189 $('.help-tab-content').not( panel ).removeClass('active').hide(); 158 190 panel.addClass('active').show();
