materio_page_title.js 730 B

123456789101112131415161718192021222324252627
  1. // @codekit-prepend "gui.js"
  2. (function($) {
  3. MaterioPageTitle = function(){
  4. function init(){
  5. $(document).bind('materio-page-title-refresh-block', onRefreshBlock);
  6. };
  7. function onRefreshBlock(event){
  8. trace('onRefreshBlock', event);
  9. // var url = Drupal.settings.basePath+Drupal.settings.pathPrefix+'materio_page_title/refresh/block';
  10. // $.getJSON(url, function(json){
  11. // trace('page title json', json);
  12. // $('#block-materio-page-title-materio-page-title').replaceWith(json.block);
  13. // });
  14. if(typeof event.title !== 'undefined')
  15. $('#block-materio-page-title-materio-page-title h1').html(event.title);
  16. };
  17. init();
  18. };
  19. var materiopagetitle = new MaterioPageTitle();
  20. })(jQuery);