Working on a dashboard page for users with limited possibilities, I had to disable the close and minimize webpart functionality. Instead of just hiding the functions, I chose to have a minimalistic view and hide SharePoint WebPart header menu dropdown arrow.
The webpart header consist of following parts:
tr class =ms-WPHeader (which is the header)
td class = ms-wpTdSpace (white space)
td class = ms-WPHeaderTd (the actual title)
td class = ms-WPHeaderTdMenu (which has the dropdown arrow and menu)
td class = ms-WPHeaderTdSelection (which has the selection checkbox)
td class = ms-wpTdSpace (white space)
So if you want to hide the arrow, you need:
<style type="text/css"> .ms-WPHeaderTdMenu {display:none} </style>
If you want to hide the selection box, you need:
<style type="text/css"> .ms-WPHeaderTdSelection {display:none} </style>
If we do with this method will loss the same when you want to edit the webpart.
True, you can add a check on the edit part of the url.
How do you add a check on the url?
You could do something like this:
http://sharepoint.stackexchange.com/questions/12792/how-do-i-know-if-the-page-is-in-edit-mode-from-javascript