[IMP] : on tweet popover hover should show pointer

[FIX] : Sometimes selecting some portion of text,don't show twitter popover.

bzr revid: aja@tinyerp.com-20140322094821-koaudrwpinskruy5
This commit is contained in:
ajay javiya (OpenERP) 2014-03-22 15:18:21 +05:30
parent 7e4d71f6fa
commit 690cd34d69
4 changed files with 17 additions and 8 deletions

View File

@ -27,12 +27,13 @@
}
},
popOver : function() {
this.destroy();
if(this.getSelection('string').length < option.minLength)
return;
var data = this.getContent();
var range = this.getSelection();
var newNode = document.createElement("mark");
range.surroundContents(newNode);
range.insertNode(newNode);
$('mark').addClass(option.className);
$('.'+option.className).popover({trigger:'manual', placement: option.placement, html: true
, content:function(){

View File

@ -156,3 +156,7 @@ p.post-meta {
overflow: auto;
font-weight: normal;
}
mark + .popover {
cursor: pointer;
}

View File

@ -138,3 +138,6 @@ p.post-meta
width: 250px
overflow: auto
font-weight: normal
mark + .popover
cursor: pointer

View File

@ -31,18 +31,19 @@
}),
edit: function () {
$('.popover').remove();
$('mark').contents().unwrap();
this._super();
var vHeight = $(window).height();
$('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', {
'post_id' : $('#blog_post_name').attr('data-oe-id'),
'image' : $('.cover')[0].style.background.replace('url(','').replace(')',''),
});
return this._super();
if ($('.cover').length){
openerp.jsonRpc("/blogpsot/change_background", 'call', {
'post_id' : $('#blog_post_name').attr('data-oe-id'),
'image' : $('.cover').css('background-image').replace('url(','').replace(')',''),
});
}
this._super();
},
clean_bg : function(vHeight) {
$('.cover_header').css({"background-image":'none', 'min-height': vHeight});
@ -51,7 +52,7 @@
var self = this;
var editor = new website.editor.ImageDialog();
editor.on('start', self, function (o) {
o.url = $('.cover_header')[0] ? $('.cover_header')[0].style.background.replace('url(','').replace(')','') : '';
o.url = $('.cover_header').length ? $('.cover_header').css('background-image').replace('url(','').replace(')','') : '';
});
editor.on('save', self, function (o) {
$('.cover_header').css({"background-image": o.url && o.url !== "" ? 'url(' + o.url + ')' : "", 'min-height': vHeight})