Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Is there any way to remove the text below the noteboard webpart when there is no comments?

"There are no notes posted yet. You can use notes to comment on a page, document, or external site. When you create notes they will appear here and for easy retrieval. Other people can also view the notes you post.

Right click or drag and drop this link to your browser's favorites or bookmarks toolbar to use notes to comment on external sites. Click here for more information about this and other social networking features in Microsoft SharePoint Server 2010."

I tried the to remove using jquery with no sucess.

$('span.socialcomment-username > a').prop('onclick', '').unbind('click'); 

$('.socialcomment-username a').attr('onclick', '').unbind('click');
share|improve this question

1 Answer 1

You may consider using a timer job, because that text is set using JS and doesn't render on document ready. Here's a workaround I implemented.

var timer = SetInterval(setInterval,processComments, 2000);


function processComments() {
    if(!checkCommentsValid()) {


        // Hide empty note board message
        jQuery('.ms-socialCommentPaging ~ div:contains("There are no notes posted yet. You can use notes to comment on a page, document, or external site. When you create notes they will appear here and")').html(""); 


        clearInterval(timer);
    }
}


function checkCommentsValid() {

    var hideEmptyMessage = jQuery('.ms-socialCommentPaging ~ div:contains("There are no notes posted yet. You can use notes to comment on a page, document, or external site. When you create notes they will appear here and")').html() == "";
    return hideEmptyMessage;
}
share|improve this answer
1  
The only limitation is that you will get a split second (depends how long you set the timer interval) of showing those lines before they disappear. –  K2so Jul 10 '12 at 3:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.