materio-base-legacy/js/materio_page_title.js
bachy 2601c718c2 update
- added materio_user.module (add permission to view the profile page)
- materio_serach_api.pages : limit actu items for anonymous
- materio_search_api_ajax.pages & materio_flag.pages : redirect to real page if current page not corresponding on ajax request (solve the view mode block visibility on user edit profile page)
- materio_flag : added edit lists functionalities ++ get_list_page_title func

Signed-off-by: bachy <git@g-u-i.net>
2012-11-21 10:06:34 +01:00

40 lines
1.1 KiB
JavaScript

// @codekit-prepend "gui.js"
(function($) {
MaterioPageTitle = function(){
function init(){
$(document)
.bind('materio-page-title-refresh-block', onRefreshBlock)
.bind('list-edited', onListEdited);
};
function onRefreshBlock(event){
trace('MaterioPageTitle :: onRefreshBlock', event);
// var url = Drupal.settings.basePath+Drupal.settings.pathPrefix+'materio_page_title/refresh/block';
// $.getJSON(url, function(json){
// trace('page title json', json);
// $('#block-materio-page-title-materio-page-title').replaceWith(json.block);
// });
if(typeof event.title !== 'undefined')
$('#block-materio-page-title-materio-page-title h1').html(event.title);
};
function onListEdited(event){
trace('MaterioPageTitle :: onListEdited', event);
// this is for refreshing page title when list title was just edited AND this list is the cirreunt list
if($("#materio-page-title ."+event.name).length)
$('a.open-list.'+event.name).eq(0).trigger('click');
};
init();
};
var materiopagetitle = new MaterioPageTitle();
})(jQuery);