wait the sidekick | Community
Skip to main content
New Participant
October 16, 2015
Solved

wait the sidekick

  • October 16, 2015
  • 9 replies
  • 1514 views

Hi,

i need to wait the appearance of the sidekick popup for adding a div on the little black arrow on the top right.

I can plays with the lower icons (edit, preview,design) but not with the icon that i want.

If i run a javascript function like these:

$(window).load(function() { alert("id"+$( ".x-tool-toggle" ).attr('id')); });

The id is undefined. How can i resolve my problem?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by edubey

What do you mean by graphics will be different? Are you customizing the UI of sidekick?

As far as sidekick code is concern,

CQ.WCM.launchSidekick("<%= currentPage.getPath() %>",{ propsDialog: "<%= dlgPath == null ? "" : dlgPath %>", locked: <%= currentPage.isLocked() %>, adminUrl: "/siteadmin", previewReload: "true" }) 

If you are creating init.jsp in your project, then don't call init.jsp present in /libs When the project started why dont you override default init.jsp. which is always recommended. Wht you want to achieve has been suggested to you as recommended approach.

9 replies

edubey
edubeyAccepted solution
New Participant
October 16, 2015

What do you mean by graphics will be different? Are you customizing the UI of sidekick?

As far as sidekick code is concern,

CQ.WCM.launchSidekick("<%= currentPage.getPath() %>",{ propsDialog: "<%= dlgPath == null ? "" : dlgPath %>", locked: <%= currentPage.isLocked() %>, adminUrl: "/siteadmin", previewReload: "true" }) 

If you are creating init.jsp in your project, then don't call init.jsp present in /libs When the project started why dont you override default init.jsp. which is always recommended. Wht you want to achieve has been suggested to you as recommended approach.

edubey
New Participant
October 16, 2015

I guess, you can easily use this.

$(document).ready(function(){ alert("id"+$( ".x-tool-toggle" ).attr('id')); });

Not clearly sure what you are trying to achieve. Please share your use case / requirement clearly so that community can provide you good answer.

Thanks

Lokesh_Shivalingaiah
New Participant
October 16, 2015

can you elaborate on your use case ?

New Participant
October 16, 2015

I need a visible div in edit mode and a hidden div in preview mode. (sidekick attached)

When the user clicks the lens of the preview is not forced the refresh of the page so i can't do it in a normal way. I can't force the refresh why i have the rule to not edit the foundation/libs components.

I can resolve my problem with a js function that is called when the user clicks the lens and another js function when the user clicks the button on the top right corner (little black arrow). The first function works fine but when the second function is called doesn't find the class "x-tool-toogle" (the class of the button on the top right corner). If i launch a function after the load of the page the element with class "x-tool-toggle" is undefined so i can't continue.

 

Thanks for the help

New Participant
October 16, 2015

Thanks for the help.

I thought that the file was a system file loaded by cq5 and not an include row.

I have found the indicted row.

Case closed, thanks

New Participant
October 16, 2015

Another solution is the file inside libs/wcm/core/components/init, if i add the refresh mode my problem is resolved.

I can't modify this file.

Is there a way to have a custom version of this file inside my project?

edubey
New Participant
October 16, 2015

Yes, its recommended not to change anything in /libs.

You can create new init.jsp in your project setup location /apps/project/init.jsp and include in the template. Copy code from /libs init.jsp file to your file.

Check this for help : https://docs.adobe.com/docs/en/cq/5-6-1/howto/website.html

New Participant
October 16, 2015

I can't simply copy the code from init.jsp to my project because the graphics of the sidekick will be different.

The shadow is in the wrong position and if i scroll the sidekick is duplicated.

smacdonald2008
New Participant
October 16, 2015

I am not sure what "wait the sidekick" means - please clarify.