留言板
Should hide images based on Toggle Edit Control
Revathi Vadlamudi,修改在7 年前。
Should hide images based on Toggle Edit Control
Junior Member 帖子: 82 加入日期: 14-11-14 最近的帖子
I have to hide some icons based on 'Toggle Edit Control' check/uncheck. Below code is for displaying 'Toggle Edit Control'.
But there is no click function in it. Can someone please help me on this. Currently I am using Liferay 6.0.5
<li class="toggle-controls" id="<portlet:namespace />toggleControls">
<a href="javascript:;">
<liferay-ui:message key="toggle-edit-controls" />
</a>
</li>
But there is no click function in it. Can someone please help me on this. Currently I am using Liferay 6.0.5
Revathi Vadlamudi,修改在7 年前。
RE: Should hide images based on Toggle Edit Control (答复)
Junior Member 帖子: 82 加入日期: 14-11-14 最近的帖子<aui:script use="liferay-util">
var A = AUI();
var docBody = A.getBody();
if (docBody.hasClass('controls-hidden')) {
$(".test").hide();
$(".lfr-autorow-links").hide();
}
A.one('li.toggle-controls').on('click', function(e) {
var controlState = (docBody.hasClass('controls-visible') ? 'hidden' : 'visible');
if (controlState != 'visible') {
$(".test").hide();
$(".lfr-autorow-links").hide();
}else{
$(".test").show();
$(".lfr-autorow-links").show();
}
});
</aui:script>