feat: Document hover cards (#1346)
* stash * refactor * refactor, styling * tweaks * pointer * styling * fi: Hide when printing * fix: No hover cards on shared links * remove suppressions no longer needed * fix: Don't show hover cards when editing, they get in the way * fix: Prevent hover card from going off rhs edge of screen * fix: Remount hover card when changing between links * fix: allow one part domains in links (#1350) * allow one part domains in links * no TLD when only one part domain * return null for parseDomain of empty string * fix fiddly hover preview behavior * WIP * refactor hover preview * fix: Non-rounded bottom corners * fix: Fixes an edgecase where mounting the nested editor in hovercard causesdocument to scroll if there is a hash in the url * fix: Incorrect document preview rendering * lint Co-authored-by: Nan Yu <thenanyu@gmail.com> Co-authored-by: Nan Yu <nan@getoutline.com>
This commit is contained in:
@@ -117,7 +117,6 @@ export default class Document extends BaseModel {
|
||||
@action
|
||||
disableEmbeds = () => {
|
||||
this.embedsDisabled = true;
|
||||
debugger;
|
||||
};
|
||||
|
||||
@action
|
||||
@@ -210,6 +209,16 @@ export default class Document extends BaseModel {
|
||||
return this.store.duplicate(this);
|
||||
};
|
||||
|
||||
getSummary = (paragraphs: number = 4) => {
|
||||
const result = this.text
|
||||
.trim()
|
||||
.split("\n")
|
||||
.slice(0, paragraphs)
|
||||
.join("\n");
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
download = async () => {
|
||||
// Ensure the document is upto date with latest server contents
|
||||
await this.fetch();
|
||||
|
||||
Reference in New Issue
Block a user