why pushed button in the sidekick don't display sometimes?
Hi there,
I add following JS code under the folder apps\myApp\clientlib
CQ.Ext.ns("MyClientLib"); MyClientLib.ContentFinder = { addToCart: function(sk){ var pagePanel = sk.panels["PAGE"]; var button = pagePanel.findBy(function(comp){ return comp["name"] == "ADD2_CART"; }, pagePanel); if(button && button.length > 0){ return; } button = { xtype: "button", scope: sk, name: "ADD2_CART", text: "Add to cart", "context": [ CQ.wcm.Sidekick.PAGE ], handler: function(){ //store to cart var pagePath = CQ.WCM.getPagePath(); var params = {"nodePath": pagePath}; CQ.shared.HTTP.post("/bin/mySearchServlet", function(options, success, response) { if (!success) { CQ.Ext.Msg.alert( CQ.I18n.getMessage("Error"), CQ.I18n.getMessage("Could not add current page to cart.")); } else { CQ.Ext.Msg.alert("Success","Current page has been added to the cart."); } },params); } }; pagePanel.insert(10,button); sk.actns.push(button); } }; (function(){ var result; var ipAddress; CQ.Ext.Ajax.request({ url: CQ.HTTP.externalize("/bin/customer"), method: "GET", success: function(response) { var info = CQ.Ext.util.JSON.decode(response.responseText); var ack = info[0].result; var ip = info[1].ipAddress; result = ack; ipAddress = ip; }, failure: function(response) { } }); var c = MyClientLib.ContentFinder; if( ( window.location.pathname == "/cf" ) || ( window.location.pathname.indexOf("/content") == 0)){ var SK_INTERVAL = setInterval(function(){ var sk = CQ.WCM.getSidekick(); if(sk){ clearInterval(SK_INTERVAL); c.addToCart(sk); } }, 250); } })();Then i begin test that in the website Geometrixx Demo Site, it is okey. But found the weird point is if i enter website Geometrixx Mobile Demo Site, the sidekick don't display the new button in another laptop.
Also i notice it is okey for Firefox browser except IE and chrome.
Anybody know how to deal with this problem to make sure the new button display in the sidekick on all browser..
Thanks a lot.
Best regards,
Brian