[IMP]: code

bzr revid: aja@tinyerp.com-20140224121420-fdq7ht4j0syxjqir
This commit is contained in:
ajay javiya (OpenERP) 2014-02-24 17:44:20 +05:30
parent 20a50c791c
commit 1e9664d74c
1 changed files with 18 additions and 15 deletions

View File

@ -8,13 +8,15 @@ $(document).ready(function() {
discussion = res['Inline Discussion']
share = res['Select to Tweet']
return def.resolve()
})
});
def.done( function(){
var content = $("#blog_content p");
if(content.length && discussion)
if(content.length && discussion){
$('#discussions_wrapper').empty();
new openerp.website.blog_discussion({'content' : content});
}
if (share) $("p").share();
})
});
$('.cover_footer').on('click',page_transist);
$('a[href^="#blog_content"]').on('click', animate);
@ -39,20 +41,21 @@ $(document).ready(function() {
function newpage() {
$.ajax({
url: newLocation,
url: newLocation,
}).done(function(data) {
$('main').append($(data).find('main').html());
$("html").stop().animate({ scrollTop: $("#wrap:last-child").offset().top }, 1000,function(e){
$("#wrap:first").remove();
$(document).scrollTop($("#wrap:last-child").offset().top);
//bind again it takes control from now on, until page relaod.
$(document).find('.cover_footer').on('click',page_transist);
$(document).find('a[href^="#blog_content"]').on('click', animate);
var content = $(document).find("#blog_content p");
if (content && discussion)
$('main').append($(data).find('main').html());
$("html").stop().animate({ scrollTop: $("#wrap:last-child").offset().top }, 1000,function(e){
$("#wrap:first").remove();
$(document).scrollTop($("#wrap:last-child").offset().top);
//bind again it takes control from now on, until page relaod.
$(document).find('.cover_footer').on('click',page_transist);
$(document).find('a[href^="#blog_content"]').on('click', animate);
var content = $(document).find("#blog_content p");
if (content && discussion){
new openerp.website.blog_discussion({'content' : content});
if (share) $("p").share();
});
}
if (share) $("p").share();
});
if (newLocation != window.location) {
history.pushState(null, null, newLocation);
}