Implement a way to deactivate hovercards.
This commit is contained in:
parent
79a849ad97
commit
5bed6d8cf7
2 changed files with 10 additions and 2 deletions
|
|
@ -33,7 +33,8 @@ app.pages.SinglePostViewer = app.views.Base.extend({
|
||||||
// formats title to html...
|
// formats title to html...
|
||||||
var html_title = app.helpers.textFormatter(this.model.get("title"), this.model);
|
var html_title = app.helpers.textFormatter(this.model.get("title"), this.model);
|
||||||
//... and converts html to plain text
|
//... and converts html to plain text
|
||||||
document.title = $('<div>').html(html_title).text();
|
document.title = $('<div>').html(html_title).text();
|
||||||
|
app.hovercard.deactivate() // No hovercards for now.
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,11 @@ app.views.Hovercard = Backbone.View.extend({
|
||||||
this.hashtags = this.$('.hashtags');
|
this.hashtags = this.$('.hashtags');
|
||||||
this.person_link = this.$('a.person');
|
this.person_link = this.$('a.person');
|
||||||
this.person_handle = this.$('p.handle');
|
this.person_handle = this.$('p.handle');
|
||||||
|
this.active = true;
|
||||||
|
},
|
||||||
|
|
||||||
|
deactivate: function() {
|
||||||
|
this.active = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
href: function() {
|
href: function() {
|
||||||
|
|
@ -22,6 +27,7 @@ app.views.Hovercard = Backbone.View.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
_mouseenterHandler: function(event) {
|
_mouseenterHandler: function(event) {
|
||||||
|
if(this.active == false) { return false }
|
||||||
var el = $(event.target);
|
var el = $(event.target);
|
||||||
if( !el.is('a') ) {
|
if( !el.is('a') ) {
|
||||||
el = el.parents('a');
|
el = el.parents('a');
|
||||||
|
|
@ -38,6 +44,7 @@ app.views.Hovercard = Backbone.View.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
_mouseleaveHandler: function(event) {
|
_mouseleaveHandler: function(event) {
|
||||||
|
if(this.active == false) { return false }
|
||||||
this.show_me = false;
|
this.show_me = false;
|
||||||
if( this.$el.is(':visible') ) {
|
if( this.$el.is(':visible') ) {
|
||||||
this.$el.fadeOut('fast');
|
this.$el.fadeOut('fast');
|
||||||
|
|
@ -112,4 +119,4 @@ app.views.Hovercard = Backbone.View.extend({
|
||||||
left: p_pos.left
|
left: p_pos.left
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue