Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. /**
  2. * Click a row.
  3. */
  4. WCOrdersTable.prototype.onRowClick = function( e ) {
  5. if ( $( e.target ).filter( 'a, a *, .no-link, .no-link *, button, button *' ).length ) {
  6. return true;
  7. }
  8.  
  9. if ( window.getSelection && window.getSelection().toString().length ) {
  10. return true;
  11. }
  12.  
  13. var $row = $( this ).closest( 'tr' ),
  14. href = $row.find( 'a.order-view' ).attr( 'href' );
  15.  
  16. if ( href && href.length ) {
  17. e.preventDefault();
  18.  
  19. if ( e.metaKey || e.ctrlKey ) {
  20. window.open( href, '_blank' );
  21. } else {
  22. window.location = href;
  23. }
  24. }
  25. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement