You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
766 B
38 lines
766 B
<?php
|
|
|
|
namespace App\Admin\Extensions\Form;
|
|
|
|
use Encore\Admin\Form\Field;
|
|
|
|
class AddSpecification extends Field
|
|
{
|
|
protected $view = 'admin.add-specification';
|
|
|
|
protected static $css = [
|
|
'/vendor/wangEditor-3.1.1/release/wangEditor.css',
|
|
];
|
|
|
|
protected static $js = [
|
|
'/vendor/wangEditor-3.1.1/release/wangEditor.js',
|
|
];
|
|
|
|
public function render()
|
|
{
|
|
$name = $this->formatName($this->column);
|
|
|
|
$this->script = <<<EOT
|
|
|
|
var E = window.wangEditor
|
|
var editor = new E('#{$this->id}');
|
|
editor.customConfig.zIndex = 0
|
|
editor.customConfig.uploadImgShowBase64 = true
|
|
editor.customConfig.onchange = function (html) {
|
|
$('input[name=$name]').val(html);
|
|
}
|
|
editor.create()
|
|
|
|
EOT;
|
|
return parent::render();
|
|
}
|
|
}
|