Advait Trivedi 12 年之前 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() ? 请登录以投票。 以……回复 取消 Erik Andersson Advait Trivedi 12 年之前 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. 请登录以投票。 以……回复 取消
Erik Andersson Advait Trivedi 12 年之前 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. 请登录以投票。 以……回复 取消
Adrian Rodriguez Monedero 12 年之前 This shorter version should also work. shouldn't it?var isPrivateLayout = themeDisplay.isPrivateLayout() == 'true'; 请登录以投票。 以……回复 取消
Erik Andersson 12 年之前 Adrian, yes of course that works and is better than using the conditional operator in this case. Thanks. 请登录以投票。 以……回复 取消
Kyrre Myrbostad 12 年之前 Hi, this looks very promising. However my themeDisplay object is always empty, is there some setting in portal-ext.properties to enable it? 请登录以投票。 以……回复 取消 Erik Andersson Kyrre Myrbostad 12 年之前 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. 请登录以投票。 以……回复 取消
Erik Andersson Kyrre Myrbostad 12 年之前 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. 请登录以投票。 以……回复 取消