Skip to content

Commit

Permalink
Adds link editing 🦜
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeeJab committed May 11, 2020
1 parent 529e66d commit 093305a
Show file tree
Hide file tree
Showing 6 changed files with 311 additions and 146 deletions.
9 changes: 9 additions & 0 deletions assets/demo/mobiledoc.css
Expand Up @@ -149,3 +149,12 @@
.__mobiledoc-tooltip a:hover {
text-decoration: underline;
}

.__mobiledoc-tooltip__edit-link {
border: none;
border-radius: 5px;
-webkit-appearance: none;
margin-left: 5px;
cursor: pointer;
font-size: 15px;
}
301 changes: 186 additions & 115 deletions assets/demo/mobiledoc.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions src/css/mobiledoc-kit.css
Expand Up @@ -149,3 +149,12 @@
.__mobiledoc-tooltip a:hover {
text-decoration: underline;
}

.__mobiledoc-tooltip__edit-link {
border: none;
border-radius: 5px;
-webkit-appearance: none;
margin-left: 5px;
cursor: pointer;
font-size: 15px;
}
8 changes: 5 additions & 3 deletions src/js/editor/editor.js
@@ -1,4 +1,4 @@
import Tooltip from '../views/tooltip';
import Tooltip, { DEFAULT_TOOLTIP } from '../views/tooltip';
import PostEditor from './post';
import ImageCard from '../cards/image';
import { DIRECTION } from '../utils/key';
Expand Down Expand Up @@ -56,7 +56,8 @@ const defaults = {
throw new MobiledocError(`Unknown atom encountered: ${env.name}`);
},
mobiledoc: null,
html: null
html: null,
tooltip: DEFAULT_TOOLTIP
};

const CALLBACK_QUEUES = {
Expand Down Expand Up @@ -272,7 +273,8 @@ class Editor {
_addTooltip() {
this.addView(new Tooltip({
rootElement: this.element,
showForTag: 'a'
showForTag: 'a',
editor: this
}));
}

Expand Down

0 comments on commit 093305a

Please sign in to comment.