[FIX] : change the cover and use an existing one, it is too big

bzr revid: aja@tinyerp.com-20140318130537-yst48p45st4n78bz
This commit is contained in:
ajay javiya (OpenERP)
2014-03-18 18:35:37 +05:30
parent 509588710d
commit b54833d392
4 changed files with 16 additions and 16 deletions
@@ -34,11 +34,9 @@ p.post-meta {
.cover_header {
color: white;
min-height: 400px;
height: 100vh;
}
.cover_header .blog_title {
padding-top: 20vh;
padding-top: 10%;
}
.cover_header h1 {
font-weight: bold;
@@ -31,10 +31,8 @@ p.post-meta
.cover_header
color: white
min-height : 400px
height: 100vh
.blog_title
padding-top : 20vh
padding-top : 10%
h1
font-weight: bold
h2.text-muted
@@ -31,8 +31,10 @@
}),
edit: function () {
this._super();
$('body').on('click', '#change_cover',_.bind(this.change_bg));
$('body').on('click', '#clear_cover',_.bind(this.clean_bg));
var top_nav = _.isNull($('#website-top-navbar').height()) ? 0 : $('#website-top-navbar').height();
var vHeight = $(window).height() - ($('header').height() + top_nav);
$('body').on('click','#change_cover',_.bind(this.change_bg,{},vHeight));
$('body').on('click', '#clear_cover',_.bind(this.clean_bg,{},vHeight));
},
save : function() {
openerp.jsonRpc("/blogpsot/change_background", 'call', {
@@ -41,18 +43,17 @@
});
return this._super();
},
clean_bg : function() {
$('.cover').css("background-image","");
clean_bg : function(vHeight) {
$('.cover_header').css({"background-image":"", 'min-height': vHeight});
},
change_bg : function() {
change_bg : function(vHeight) {
var self = this;
var editor = new website.editor.ImageDialog();
editor.on('start', self, function (o) {
o.url = $('.cover')[0].style.background.replace('url(','').replace(')','');
o.url = $('.cover_header')[0].style.background.replace('url(','').replace(')','');
});
editor.on('save', self, function (o) {
$('.cover').css("background-image", o.url && o.url !== "" ? 'url(' + o.url + ')' : "" )
.addClass('cover_header');
$('.cover').css({"background-image": o.url && o.url !== "" ? 'url(' + o.url + ')' : "", 'min-height': vHeight})
});
editor.appendTo('body');
},
@@ -1,6 +1,9 @@
$(document).ready(function() {
var discussion = false;
var share = false;
var top_nav = _.isNull($('#website-top-navbar-placeholder').height()) ? 0 : $('#website-top-navbar-placeholder').height();
var vHeight = $(window).height() - ($('header').height() + top_nav);
$('.cover_header').css('min-height', vHeight);
function page_transist(event) {
event.preventDefault();
newLocation = $('.js_next')[0].href;
@@ -56,9 +59,9 @@ $(document).ready(function() {
page_upwards();
//bind again it takes control from now on, until page relaod.
$(document).find('.cover_footer').on('click',page_transist);
console.log($(data).find('#blog_author'))
$(document).find('.cover_header').css('min-height', vHeight);
$(document).find('a[href^="#blog_content"]').on('click', animate);
if (share) $("p,h1,h2,h3,h4,ul").share({'author_name':$(data).find('#blog_author:first').text()});
if (share) $("p,h1,h2,h3,h4,ul").share({'author_name':$(data).find('#blog_author').text()});
if (newLocation != window.location)
history.pushState(null, null, newLocation);
});