Skip to content
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

Froala 3 fixes #59

Closed
wants to merge 17 commits into from
2 changes: 1 addition & 1 deletion dist/amd/froala-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ define(['exports', 'aurelia-framework', 'aurelia-binding', './froala-editor-conf
}
})];

this.editor = new _froala_editorPkgdMin2.default('#' + this.element.id + ' ' + editorSelector, Object.assign({}, this.config), function () {
this.editor = new _froala_editorPkgdMin2.default(this.element.querySelector(editorSelector), Object.assign({}, this.config), function () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it will select first element of that type. not that particular element?

Copy link
Author

@alexisszabo alexisszabo Nov 19, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's correct. However, for example, since we are searching only within the element itself, and there is only one 'textarea', we will get that.

This is similar to the old code:
if (this.config.iframe) {
this.instance = this.element.getElementsByTagName('textarea')[0];
}
else {
this.instance = this.element.getElementsByTagName('div')[0];
}

_this.editor.html.set(_this.value);

if (_this.eventHandlers && _this.eventHandlers.length != 0) {
Expand Down
2 changes: 1 addition & 1 deletion dist/commonjs/froala-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ var FroalaEditor1 = exports.FroalaEditor1 = (_dec = (0, _aureliaFramework.custom
}
})];

this.editor = new _froala_editorPkgdMin2.default('#' + this.element.id + ' ' + editorSelector, Object.assign({}, this.config), function () {
this.editor = new _froala_editorPkgdMin2.default(this.element.querySelector(editorSelector), Object.assign({}, this.config), function () {
_this.editor.html.set(_this.value);

if (_this.eventHandlers && _this.eventHandlers.length != 0) {
Expand Down
2 changes: 1 addition & 1 deletion dist/es2015/froala-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export let FroalaEditor1 = (_dec = customElement('froala-editor'), _dec2 = injec
}
})];

this.editor = new FroalaEditor(`#${this.element.id} ${editorSelector}`, Object.assign({}, this.config), () => {
this.editor = new FroalaEditor(this.element.querySelector(editorSelector), Object.assign({}, this.config), () => {
this.editor.html.set(this.value);

if (this.eventHandlers && this.eventHandlers.length != 0) {
Expand Down
2 changes: 1 addition & 1 deletion dist/system/froala-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ System.register(['aurelia-framework', 'aurelia-binding', './froala-editor-config
}
})];

this.editor = new FroalaEditor('#' + this.element.id + ' ' + editorSelector, Object.assign({}, this.config), function () {
this.editor = new FroalaEditor(this.element.querySelector(editorSelector), Object.assign({}, this.config), function () {
_this.editor.html.set(_this.value);

if (_this.eventHandlers && _this.eventHandlers.length != 0) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aurelia-froala-editor",
"version": "3.0.3",
"version": "3.0.3-2",
"description": "Aurelia plugin for Froala WYSIWYG HTML rich text editor.",
"keywords": [
"aurelia",
Expand Down
2 changes: 1 addition & 1 deletion src/froala-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class FroalaEditor1 {
];

// Initialize editor.
this.editor = new FroalaEditor(`#${this.element.id} ${editorSelector}`, Object.assign({}, this.config), () => {
this.editor = new FroalaEditor(this.element.querySelector(editorSelector), Object.assign({}, this.config), () => {
// Set initial HTML value.
this.editor.html.set(this.value);

Expand Down