mirror of
https://github.com/Karaka-Management/oms-Editor.git
synced 2026-02-13 00:38:42 +00:00
CS fixes
This commit is contained in:
parent
340cda9c1e
commit
b69556e07e
|
|
@ -12,11 +12,11 @@
|
||||||
jsOMS.Modules.Models.Editor.Editor.prototype.bind = function()
|
jsOMS.Modules.Models.Editor.Editor.prototype.bind = function()
|
||||||
{
|
{
|
||||||
const editorButtons = this.editor.getElementsByClassName('editor-button'),
|
const editorButtons = this.editor.getElementsByClassName('editor-button'),
|
||||||
editorTitle = this.editor.getElementsByClassName('editor-title')[0],
|
editorTitle = this.editor.getElementsByClassName('editor-title')[0],
|
||||||
editorContent = this.editor.getElementsByClassName('editor-content')[0],
|
editorContent = this.editor.getElementsByClassName('editor-content')[0],
|
||||||
editorPreview = this.editor.getElementsByClassName('editor-preview')[0],
|
editorPreview = this.editor.getElementsByClassName('editor-preview')[0],
|
||||||
length = editorButtons.length,
|
length = editorButtons.length,
|
||||||
self = this;
|
self = this;
|
||||||
|
|
||||||
for(let i = 0; i < length; i++) {
|
for(let i = 0; i < length; i++) {
|
||||||
editorButtons[i].addEventListener('click', function(event) {
|
editorButtons[i].addEventListener('click', function(event) {
|
||||||
|
|
@ -27,14 +27,13 @@
|
||||||
|
|
||||||
jsOMS.Modules.Models.Editor.Editor.prototype.getSelectedText = function()
|
jsOMS.Modules.Models.Editor.Editor.prototype.getSelectedText = function()
|
||||||
{
|
{
|
||||||
let text = '';
|
let text = '';
|
||||||
const activeEl = document.activeElement;
|
const activeEl = document.activeElement;
|
||||||
const activeElTagName = activeEl ? activeEl.tagName.toLowerCase() : null;
|
const activeElTagName = activeEl ? activeEl.tagName.toLowerCase() : null;
|
||||||
|
|
||||||
if (
|
if ((activeElTagName === 'textarea' || activeElTagName === 'input')
|
||||||
(activeElTagName === 'textarea' || activeElTagName === 'input') &&
|
&& /^(?:text|search|password|tel|url)$/i.test(activeEl.type)
|
||||||
/^(?:text|search|password|tel|url)$/i.test(activeEl.type) &&
|
&& (typeof activeEl.selectionStart === 'number')
|
||||||
(typeof activeEl.selectionStart === 'number')
|
|
||||||
) {
|
) {
|
||||||
text = activeEl.value.slice(activeEl.selectionStart, activeEl.selectionEnd);
|
text = activeEl.value.slice(activeEl.selectionStart, activeEl.selectionEnd);
|
||||||
} else if (window.getSelection) {
|
} else if (window.getSelection) {
|
||||||
|
|
|
||||||
|
|
@ -27,5 +27,5 @@ use phpOMS\Stdlib\Base\Enum;
|
||||||
abstract class PermissionState extends Enum
|
abstract class PermissionState extends Enum
|
||||||
{
|
{
|
||||||
/* public */ const DASHBOARD = 1;
|
/* public */ const DASHBOARD = 1;
|
||||||
/* public */ const DOC = 2;
|
/* public */ const DOC = 2;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user