Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Groupon.refreshCSS = function() {
- var i,a,s;
- a=document.getElementsByTagName('link');
- for(i=0;i<a.length;i++){
- s=a[i];
- if(s.rel.toLowerCase().indexOf('stylesheet')>=0&&s.href) {
- var h=s.href.replace(/(&|%5C?)forceReload=\d+/,'');
- s.href=h+(h.indexOf('?')>=0?'&':'?')+'forceReload='+(new Date().valueOf())
- }
- }
- }
- //start sass watch command like this
- //sass --watch public/stylesheets/sass:public/stylesheets --load-path public/stylesheets/sas- load-path public/stylesheets/sass/base --load-path --load-path public/stylesheets/sass/base --load-path public/stylesheets/sass/app/shared --debug-info --require lib/sass_extensions.rb --require lib/asset_fingerprint_cache.rb
- $(document).observe('focus', function(e){
- Groupon.refreshCSS();
- });
- //
- $(document).observe('keydown', function(e){
- // // mapped to ctrl + R, but feel free to change it if you want
- if(e.keyCode == 82 && e.ctrlKey)
- Groupon.refreshCSS();
- });
Add Comment
Please, Sign In to add comment