mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Hiding tooltip when no longer needed.
This commit is contained in:
parent
393346e07a
commit
16a2d2c50e
1 changed files with 7 additions and 6 deletions
|
@ -721,23 +721,23 @@ NEWSBLUR.Views.StoryDetailView = Backbone.View.extend({
|
|||
// classApplier.addClass("NB-temporary");
|
||||
rangy.init();
|
||||
this.$(".NB-starred-story-selection-highlight,[data-tippy]").contents().unwrap();
|
||||
|
||||
$doc.attr('id', 'NB-highlighting');
|
||||
|
||||
this.highlighter = rangy.createHighlighter($doc.get(0));
|
||||
this.highlighter.addClassApplier(classApplier);
|
||||
|
||||
this.highlighter.highlightSelection(applier_class, {
|
||||
containerElementId: "NB-highlighting"
|
||||
});
|
||||
// this.serialized_highlight = rangy.serializeSelection(rangy.getSelection(), true, $doc.get(0));
|
||||
|
||||
this.serialized_highlight = this.highlighter.serialize();
|
||||
console.log(['mouseup_check_selection 1', this.serialized_highlight, this.highlighter.serialize()]);
|
||||
// this.highlighter.deserialize(this.serialized_highlight);
|
||||
console.log(['mouseup_check_selection 1', this.serialized_highlight]);
|
||||
|
||||
if (this.tooltip && this.tooltip.tooltips && this.tooltip.tooltips.length) {
|
||||
this.tooltip.tooltips[0].hide();
|
||||
}
|
||||
if (!this.serialized_highlight || this.serialized_highlight == "type:textContent") {
|
||||
$doc.removeAttr('id');
|
||||
this.apply_starred_story_selections();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -758,6 +758,7 @@ NEWSBLUR.Views.StoryDetailView = Backbone.View.extend({
|
|||
$selection.removeClass('NB-starred-story-selection-highlight');
|
||||
}, this)
|
||||
});
|
||||
this.tooltip = $t;
|
||||
_.defer(function() {
|
||||
if ($t.tooltips && $t.tooltips.length) $t.tooltips[0].show();
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue