Guest User

Untitled

a guest
May 16th, 2018
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.53 KB | None | 0 0
  1. function removeTrailingDashes() {
  2.   jQuery(".post-title.column-title strong").each(function() {
  3.     //console.log(jQuery(this).html());
  4.     jQuery(this).html(jQuery(this).html().replace(/(.*) - (<span class="post-state".*<\/span>)$/g, "$1$2"));
  5.   });
  6. }
  7. removeTrailingDashes();
  8. jQuery("#status-hide").click(function() {
  9.   var postStateSpan = jQuery(".post-title.column-title .post-state");
  10.   postStateSpan.toggle(!this.checked);
  11.   if (!this.checked) {
  12.     postStateSpan.before(" - ");
  13.   } else {
  14.     removeTrailingDashes();
  15.   }
  16. });
Add Comment
Please, Sign In to add comment