Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

How to turn on Inline mode ? #30

Open
impuulse opened this issue Mar 23, 2017 · 3 comments
Open

How to turn on Inline mode ? #30

impuulse opened this issue Mar 23, 2017 · 3 comments

Comments

@impuulse
Copy link

impuulse commented Mar 23, 2017

Hello, it's my code:

`\dosamigos\tinymce\TinyMce::widget([
    'name' => 'test',
    'language' => 'ru',
    'clientOptions' => [
        'selector' => 'div.test',
        'inline' => true,
        'plugins' => [
            'advlist autolink lists link image charmap print preview anchor',
            'searchreplace visualblocks code fullscreen',
            'insertdatetime media table contextmenu paste'
        ],
        'toolbar' => 'insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image'
    ]
]);
<div class = "test"></div>`

but only clean textarea

@tonydspaniard
Copy link
Member

tonydspaniard commented Jun 9, 2017

@impuulse please add a value and open your developer tools and tell me if there is any error on the console of your browser:

\dosamigos\tinymce\TinyMce::widget([
    'name' => 'test',
    'value' => 'THIS IS A TEST VALUE',
    'language' => 'ru',
    'clientOptions' => [
        'inline' => true,
        'plugins' => [
            'advlist autolink lists link image charmap print preview anchor',
            'searchreplace visualblocks code fullscreen',
            'insertdatetime media table contextmenu paste'
        ],
        'toolbar' => 'insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image'
    ]
]);

@zzeraw
Copy link

zzeraw commented Nov 10, 2017

Hi, @tonydspaniard.
I have a similar problem.
I can't use the widget in inline mode.

The following code causes such errors in the Chrome's console.

Code:

<?= \dosamigos\tinymce\TinyMce::widget([
    'name' => 'test',
    'value' => 'THIS IS A TEST VALUE',
    'language' => 'ru',
    'clientOptions' => [
        'inline' => true,
        'selector' => 'div.test',
        'plugins' => [
            'advlist autolink lists link image charmap print preview anchor',
            'searchreplace visualblocks code fullscreen',
            'insertdatetime media table contextmenu paste'
        ],
        'toolbar' => 'insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image'
    ]
]); ?>
<div class="test"></div>

Message:

Could not initialize inline editor on invalid inline target element <textarea id=​"w0" name=​"test">​THIS IS A TEST VALUE​</textarea>​
    initError @ tinymce.js:32160
    (anonymous) @ tinymce.js:42087
    each @ tinymce.js:4134
    initEditors @ tinymce.js:42085
    executeHandlers @ tinymce.js:1694
    defaultNativeHandler @ tinymce.js:1721
    readyHandler @ tinymce.js:1617

Thanks.

@tonydspaniard
Copy link
Member

The problem is that it tries to create the inline editor on a textArea. The widget requires to be modified to support inline. It must render a layer not a textarea input field.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants