Open jensb opened 13 years ago
PS. Using Rails 3.0.4 (and the Rails 3 fork of CDS).
I also had this problem last year and gave up on closure compiler. A better javascript coder than I may be able to figure it out. I would first try to upgrade to the most recent closure compiler to see if it is still a problem. Then if you have a chance, see if you can re-arrange this code in the main calendar_date_select.js file (I suspect it is a problem with the eval line):
Look around line 145 inside initCalendarDiv:
var that = this;
// create the divs
$w("top header body buttons footer bottom").each(function(name) {
eval("var " + name + "_div = that." + name + "_div = that.calendar_div.build('div', { className: 'cds_"+name+"' }, { clear: 'left'} ); ");
});
Instead of solving this, I just moved to yui from closure. The uglifier gem may also work. I've never tried it but I think it comes with Rails 3.1 so it would be worth trying. I use the jammit gem and yui 0.9.1 to do mine. Yui has newer versions that you should try but I have other unrelated problems with them.
We are using Asset Packager to compress our CSS and Javascript files. This is a great plus since it allows us to transmit only one compressed CSS and JS file, instead of (altogether) 27 files with each request.
However, when I include CDS's .js files in asset_packager's _config/assetpackages.yml, I get the following error upon clicking on a calendar icon:
It seems that something that asset_packager does, breaks CDS's javascript. What could that be?