Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
toggle
Michael Fougere
Removing the Dockbar
24 luglio 2012 12.10
Risposta

Michael Fougere

Punteggio: New Member

Messaggi: 5

Data di Iscrizione: 24 luglio 2012

Messaggi recenti

Hi, I need to remove the dockbar entirely, but still provide the functionality. At present, my solution is to create a custom link to the control panel, and provide a custom "Edit Controls" checkbox. I've managed to create the custom control panel link using only velocity.

Now, I'm trying to add the "Edit Controls" checkbox -- I've gotten the checkbox to render correctly, but it does nothing when I click it. My assumption is that there is some AUI code that I'll have to add for this, but I have no idea where to even begin. I've got a decent amount of experience with jQuery, but essentially 0 with AUI.

Following is the markup I'm using for the checkbox:
1
2<div class="dockbar" data-namespace="_145_" id="dockbar" style="float:right">
3    <ul class="aui-toolbar">
4        <li class="toggle-controls" id="_145_toggleControls"> <a href="javascript:;"> Edit Controls </a> </li>
5    </ul>
6</div>


I'd appreciate any help you can offer emoticon
David H Nebinger
RE: Removing the Dockbar
24 luglio 2012 12.28
Risposta

David H Nebinger

Community Moderator

Punteggio: Liferay Legend

Messaggi: 11052

Data di Iscrizione: 1 settembre 2006

Messaggi recenti

I think what you're missing is from the bottom of the view.jsp of the dockbar portlet, where the dockbar is initialized and the event handlers are bound to the controls.
Michael Fougere
RE: Removing the Dockbar
26 luglio 2012 9.05
Risposta

Michael Fougere

Punteggio: New Member

Messaggi: 5

Data di Iscrizione: 24 luglio 2012

Messaggi recenti

David H Nebinger:
I think what you're missing is from the bottom of the view.jsp of the dockbar portlet, where the dockbar is initialized and the event handlers are bound to the controls.


Hi, thanks for the reply. I've tried adding the following to the bottom of my portal_normal.vm (immediately before the </html>), but still no luck:

 1
 2<script type="text/javascript">
 3    var toggleCustomizedView = A.one('#<portlet:namespace />toggleCustomizedView');
 4   
 5    if (toggleCustomizedView) {
 6        toggleCustomizedView.on(
 7            'click',
 8            function(event) {
 9                A.io.request(
10                    themeDisplay.getPathMain() + '/portal/update_layout',
11                    {
12                        data: {
13                            cmd: 'toggle_customized_view',
14                            customized_view: '<%= String.valueOf(!layoutTypePortlet.isCustomizedView()) %>'
15                        },
16                        on: {
17                            success: function(event, id, obj) {
18                                window.location.href = themeDisplay.getLayoutURL();
19                            }
20                        }
21                    }
22                );
23            }
24        );
25    }
26
27    Liferay.Dockbar.init();
28    var customizableColumns = A.all('.portlet-column-content.customizable');
29   
30    if (customizableColumns.size() > 0) {
31        customizableColumns.get('parentNode').addClass('customizable');
32    }
33</script>