Changeset 26112
- Timestamp:
- 11/12/2013 11:55:23 PM (12 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-admin/js/common.js (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/js/common.js
r25677 r26112 1 /* global setUserSetting, ajaxurl, commonL10n, alert, confirm, toggleWithKeyboard, pagenow */ 1 2 var showNotice, adminMenu, columns, validateForm, screenMeta; 2 3 (function($){ … … 66 67 $t.attr('colspan', n.toString()); 67 68 } 68 } 69 }; 69 70 70 71 $(document).ready(function(){columns.init();}); 71 72 72 73 validateForm = function( form ) { 73 return !$( form ).find('.form-required').filter( function() { return $('input:visible', this).val() == ''; } ).addClass( 'form-invalid' ).find('input:visible').change( function() { $(this).closest('.form-invalid').removeClass( 'form-invalid' ); } ).size(); 74 } 74 return !$( form ) 75 .find( '.form-required' ) 76 .filter( function() { return $( 'input:visible', this ).val() === ''; } ) 77 .addClass( 'form-invalid' ) 78 .find( 'input:visible' ) 79 .change( function() { $( this ).closest( '.form-invalid' ).removeClass( 'form-invalid' ); } ) 80 .size(); 81 }; 75 82 76 83 // stub for doing better warnings … … 161 168 162 169 $(document).ready( function() { 163 var lastClicked = false, checks, first, last, checked, sliced, menu = $('#adminmenu'), mobileEvent, 164 pageInput = $('input.current-page'), currentPage = pageInput.val(); 170 var checks, first, last, checked, sliced, mobileEvent, transitionTimeout, focusedRowActions, 171 lastClicked = false, 172 menu = $('#adminmenu'), 173 pageInput = $('input.current-page'), 174 currentPage = pageInput.val(); 165 175 166 176 // when the menu is folded, make the fly-out submenu header clickable … … 169 179 }); 170 180 171 $('#collapse-menu').on('click.collapse-menu', function( e){181 $('#collapse-menu').on('click.collapse-menu', function() { 172 182 var body = $( document.body ), respWidth; 173 183 … … 227 237 228 238 menu.find('li.wp-has-submenu').hoverIntent({ 229 over: function( e){239 over: function() { 230 240 var b, h, o, f, m = $(this).find('.wp-submenu'), menutop, wintop, maxtop, top = parseInt( m.css('top'), 10 ); 231 241 … … 301 311 var unchecked = $(this).closest('tbody').find(':checkbox').filter(':visible').not(':checked'); 302 312 $(this).closest('table').children('thead, tfoot').find(':checkbox').prop('checked', function() { 303 return ( 0 == unchecked.length );313 return ( 0 === unchecked.length ); 304 314 }); 305 315 … … 336 346 337 347 // Show row actions on keyboard focus of its parent container element or any other elements contained within 338 var transitionTimeout, focusedRowActions;339 348 $( 'td.post-title, td.title, td.comment, .bookmarks td.column-name, td.blogname, td.username, .dashboard-comment-wrap' ).focusin(function(){ 340 349 clearTimeout( transitionTimeout ); … … 397 406 }); 398 407 399 $('#newcontent').bind('blur.wpevent_InsertTab', function( e) {408 $('#newcontent').bind('blur.wpevent_InsertTab', function() { 400 409 if ( this.lastKey && 9 == this.lastKey ) 401 410 this.focus(); … … 403 412 404 413 if ( pageInput.length ) { 405 pageInput.closest('form').submit( function( e){414 pageInput.closest('form').submit( function() { 406 415 407 416 // Reset paging var for new filters/searches but not for bulk actions. See #17685.
Note: See TracChangeset
for help on using the changeset viewer.