Advait Trivedi Hace 12 años Hi Erik, Thanks for this. themeDisplay is indeed very used in JS. Do we always have to use themeDisplay inside AUI.ready() function ? or is accessible directly on any Liferay page with AUI.ready() ? Por favor identifíquese para votar. Contestar como... Cancelar Erik Andersson Advait Trivedi Hace 12 años Hi Advait, the themeDisplay object is put on the global context object (in general the window object) so yes it can be accessed outside the AUI sandbox, i.e. outside the AUI.ready() function. Por favor identifíquese para votar. Contestar como... Cancelar
Erik Andersson Advait Trivedi Hace 12 años Hi Advait, the themeDisplay object is put on the global context object (in general the window object) so yes it can be accessed outside the AUI sandbox, i.e. outside the AUI.ready() function. Por favor identifíquese para votar. Contestar como... Cancelar
Adrian Rodriguez Monedero Hace 12 años This shorter version should also work. shouldn't it?var isPrivateLayout = themeDisplay.isPrivateLayout() == 'true'; Por favor identifíquese para votar. Contestar como... Cancelar
Tanweer Ahmed Ansari Hace 12 años Thanx Erik for the info. Por favor identifíquese para votar. Contestar como... Cancelar
Erik Andersson Hace 12 años Adrian, yes of course that works and is better than using the conditional operator in this case. Thanks. Por favor identifíquese para votar. Contestar como... Cancelar
Kyrre Myrbostad Hace 12 años Hi, this looks very promising. However my themeDisplay object is always empty, is there some setting in portal-ext.properties to enable it? Por favor identifíquese para votar. Contestar como... Cancelar Erik Andersson Kyrre Myrbostad Hace 12 años Hi Kyrre, no you should not have to enable anything in portal-ext.properties for this. What version of Liferay are you running? Do you get any empty themeDisplay object both inside and outside the the AUI.ready() function? Also, are you sure that your themeDisplay object is empty? If you log it to the console with console.log(themeDisplay) the output will look like "Object {}". Thus it appears to be empty, but if you click on "Object {}" you can browse down the object. Por favor identifíquese para votar. Contestar como... Cancelar
Erik Andersson Kyrre Myrbostad Hace 12 años Hi Kyrre, no you should not have to enable anything in portal-ext.properties for this. What version of Liferay are you running? Do you get any empty themeDisplay object both inside and outside the the AUI.ready() function? Also, are you sure that your themeDisplay object is empty? If you log it to the console with console.log(themeDisplay) the output will look like "Object {}". Thus it appears to be empty, but if you click on "Object {}" you can browse down the object. Por favor identifíquese para votar. Contestar como... Cancelar