Skip to content

Commit

Permalink
remove svg
Browse files Browse the repository at this point in the history
  • Loading branch information
talyguryn committed Jul 16, 2018
1 parent 643af9e commit e7777d5
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 23 deletions.
26 changes: 13 additions & 13 deletions example/plugins/header/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ class Header {
* @public
*/
save(toolsContent) {
/**
* @todo sanitize data
*/

return {
text: toolsContent.innerHTML,
level: this.currentLevel
Expand All @@ -192,10 +196,6 @@ class Header {
let text = this._element.innerHTML,
tag = this._element.tagName;

/**
* @todo sanitize data
*/

this._data.text = text;
this._data.level = tag;

Expand Down Expand Up @@ -256,28 +256,28 @@ class Header {
* @return {HTMLHeadingElement}
*/
getTag() {
/**
* Create element for current Block's level
*/
let tag;

/**
* Create default element
*/
tag = document.createElement(this.levels[0].tag);
let tagName = this.levels[0].tag;

/**
* Try to reassign to passed level element
* Find tag for current level
*/
for (let index in this.levels) {
const level = this.levels[index];

if (level.number === this._data.level) {
tag = document.createElement(level.tag);
tagName = level.tag;
break;
}
}

/**
* Create element for current Block's level
*/
let tag = document.createElement(tagName);

/**
* Add text to block
*/
Expand All @@ -301,7 +301,7 @@ class Header {
* @return {number}
*/
get currentLevel() {
let level = this.levels.find( level => level.tag === this._element.tagName);
let level = this.levels.find( level => level.number === this._data.level);

return level.number;
}
Expand Down
1 change: 0 additions & 1 deletion example/plugins/header/settings-h2.svg

This file was deleted.

1 change: 0 additions & 1 deletion example/plugins/header/settings-h3.svg

This file was deleted.

1 change: 0 additions & 1 deletion example/plugins/header/settings-h4.svg

This file was deleted.

12 changes: 5 additions & 7 deletions example/plugins/text/text.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,13 @@ class Text {
* @public
*/
save(toolsContent) {
let toolData = {
/**
* @todo sanitize data
*/

return {
text: toolsContent.innerHTML
};

return toolData;
}

/**
Expand All @@ -122,10 +124,6 @@ class Text {
get data() {
let text = this._element.innerHTML;

/**
* @todo sanitize data
*/

this._data.text = text;

return this._data;
Expand Down

0 comments on commit e7777d5

Please sign in to comment.