I am running web2py 2.0.9 and this code is in the layout.html file in this version.
I am wondering what the best way to ensure dynamically loaded or reloaded components get the same styling as the rest of the page. I don't want to add my own hack to my pages, becuase if web2py changes what it does my stuff will then be doing something different or not work. I have had a little look through the web2py source on github and it seems to me it would be more consistent for components if a function was called here: https://github.com/web2py/web2py/blob/master/applications/welcome/static/js/web2py.js#L120 that re-ran the same code found in web2py_bootstrap.js. Possibly this function could act just on the loaded/reloaded content. Does this sound a reasonable change? I'd consider making this change myself, but I'm not sure enough of what goes on here to start messing around and submitting any changes. Incidentally how would I go about submitting or requesting a change like this if I did give it a go? On Friday, 1 March 2013 11:32:26 UTC, RHC wrote: > > Thanks. It certainly looks like that code makes the change I'm thinking > of. However, I don't have a web2py_bootstrap.js in my application's static > folder. I am a few versions behind the latest, so maybe this file is a > recent addition, and another script used to perform this function in older > versions? I can't check what web2py version I'm running right now, but will > check later and post another update, > > On Friday, 1 March 2013 08:42:05 UTC, Niphlod wrote: >> >> it's pobably due to this >> >> >> https://github.com/web2py/web2py/blob/master/applications/welcome/static/js/web2py_bootstrap.js#L27 >> >> On Thursday, February 28, 2013 11:29:19 PM UTC+1, Anthony wrote: >>> >>> Please show some code. >>> >>> On Thursday, February 28, 2013 5:15:06 PM UTC-5, RHC wrote: >>>> >>>> I have a view which consists of several web2py compnents. I load these >>>> components initially using the ajax=False option so they get loaded in >>>> with >>>> the rest of the page, they then get reloaded via an ajax trapped submit >>>> button within that component. The only problem is that the buttons start >>>> off as bootstrap styled buttons (using the .btn class as far as I can >>>> see), >>>> but the reloaded component then has normal styled buttons which are >>>> missing >>>> the .btn class. >>>> >>>> I have not been able to find out what process adds the .btn class to >>>> these button so I can ensure the reloaded component ends up with the same >>>> class and styling. Does anyone have any idea how and when the .btn class >>>> gets added and the best way to re-run this process for an ajax reloaded >>>> component? >>>> >>>> -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.