modifs.mineures sans commentaires

This commit is contained in:
Jephté Clain 2024-05-27 16:11:40 +04:00
parent 1bf1fdd814
commit 4d6d518c92
1 changed files with 11 additions and 12 deletions

View File

@ -26,7 +26,7 @@ class easymdePlugin extends BasePlugin implements IParametrable {
];
const PARAMETRABLE_PARAMS_SCHEMA = [
"selector" => ["string", null, "sélecteur pour les controles"],
"selector" => ["string", "textarea:first", "sélecteur pour les controles"],
"config" => ["?array", null, "configuration de l'objet"],
];
@ -48,17 +48,16 @@ class easymdePlugin extends BasePlugin implements IParametrable {
?>
<script type="text/javascript">
jQuery.noConflict()(function($) {
var config = <?=js::qo($this->ppConfig)?>;
var selector = <?=js::qv($this->ppSelector)?>;
var $elements;
if (selector !== "") $elements = $(selector);
if (selector !== "" && $elements.length > 0) {
$elements.each(function () {
config.element = this;
new EasyMDE(config);
});
} else {
new EasyMDE(config);
let config = <?=js::qo($this->ppConfig)?>;
let selector = <?=js::qv($this->ppSelector)?>;
if (selector !== "") {
let $elements = $(selector);
if ($elements.length > 0) {
$elements.each(function () {
config.element = this;
new EasyMDE(config);
});
}
}
});
</script>