Skip to content

fix clear format #136

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/editor/Editr.vue
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,13 @@ export default {
}
}
},
exec (cmd, arg, sel){
exec (cmd, arg, sel, clearSelectionAfter){
sel !== false && this.selection && this.restoreSelection(this.selection);
document.execCommand(cmd, false, arg||"");
this.clearSelection();

if (clearSelectionAfter !== false) {
this.clearSelection();
}

this.$nextTick(this.emit);
},

Expand Down
2 changes: 1 addition & 1 deletion src/editor/locales/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import dutch from "./dutch";
import hungarian from "./hungarian";
import english from "./english";
import portuguese from "./portuguese";
import italian from "./italian";
import german from './german';
import spanish from "./spanish";

export default {
Expand Down
3 changes: 2 additions & 1 deletion src/editor/modules/image.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
<script>
import Dropzone from 'vue2-dropzone';
import bus from 'src/editor/bus.js';
import 'vue2-dropzone/dist/vue2Dropzone.css'
// wont compile
// import 'vue2-dropzone/dist/vue2Dropzone.css'

const UPLOAD_ICON = '<svg fill="#666" width="26" height="24" viewBox="0 0 2048 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1344 864q0-14-9-23l-352-352q-9-9-23-9t-23 9l-351 351q-10 12-10 24 0 14 9 23t23 9h224v352q0 13 9.5 22.5t22.5 9.5h192q13 0 22.5-9.5t9.5-22.5v-352h224q13 0 22.5-9.5t9.5-22.5zm640 288q0 159-112.5 271.5t-271.5 112.5h-1088q-185 0-316.5-131.5t-131.5-316.5q0-130 70-240t188-165q-2-30-2-43 0-212 150-362t362-150q156 0 285.5 87t188.5 231q71-62 166-62 106 0 181 75t75 181q0 76-41 138 130 31 213.5 135.5t83.5 238.5z"/></svg>'

Expand Down
7 changes: 6 additions & 1 deletion src/editor/modules/removeFormat.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
module.exports = {
title: "removeFormat",
action: ["removeFormat"],
customAction (utils) {
return [
["removeFormat", undefined, true, false],
["formatBlock", "p"]
]
},
description: "Remove formatting.\nClears headings, bold, italic, underlined text, etc.",
icon: '<svg width="1792" height="1792" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M832 1408l336-384h-768l-336 384h768zm1013-1077q15 34 9.5 71.5t-30.5 65.5l-896 1024q-38 44-96 44h-768q-38 0-69.5-20.5t-47.5-54.5q-15-34-9.5-71.5t30.5-65.5l896-1024q38-44 96-44h768q38 0 69.5 20.5t47.5 54.5z"/></svg>'
}