留言板

Remove Download Buttonn from Documents and Media Portlet

Ryan Smith,修改在7 年前。

Remove Download Buttonn from Documents and Media Portlet

New Member 帖子: 8 加入日期: 16-7-28 最近的帖子
I'm trying to access the group of buttons on the top of the portlet when you've selected a file, but they don't allow you to access them as DOM elements.
I can get the button-holder via
document.getElementById("_20_fileEntryToolbar");
but every item below that div is not recognized. I'm trying to get access to the Download button to either make it
display:none;
or to make it so once it is clicked on there will be an alert that appears.

I've found that there are quite a few elements that are loaded that can't be grabbed as DOM elements as well, including the
as well.

Any help in figuring out how I can access these areas would be amazing, thanks!
thumbnail
David H Nebinger,修改在7 年前。

RE: Remove Download Buttonn from Documents and Media Portlet

Liferay Legend 帖子: 14917 加入日期: 06-9-2 最近的帖子
Don't try to do it at the dom level, use a JSP hook to remove the elements you don't want.

Doing it at the browser level means someone with skilz can get them back and invoke them whether you want them to or not.

Removing from the JSP will not allow those folks the opportunity to restore them.
Ryan Smith,修改在7 年前。

RE: Remove Download Buttonn from Documents and Media Portlet

New Member 帖子: 8 加入日期: 16-7-28 最近的帖子
What about for making the Download button have an alert when it is clicked? You'd think that there would be some way that you could access the DOM elements.
thumbnail
David H Nebinger,修改在7 年前。

RE: Remove Download Buttonn from Documents and Media Portlet

Liferay Legend 帖子: 14917 加入日期: 06-9-2 最近的帖子
Even that sort of thing I would start a JSP hook to make it happen.

Fix at the source, not in the browser.