/** * Registers required script for the plugin to work as jQuery File Uploader */ public function registerClientScript() { Html::addCssClass($this->wrapperOptions, " single-media upload-kit"); AttachmentUploadAsset::register($this->getView()); if ($this->sortable) { JuiAsset::register($this->getView()); } $options = Json::encode($this->clientOptions); $this->getView()->registerCss(".single-media .upload-kit-input {\n height: 150px;\n width: 100%;\n}\n.single-media .upload-kit-item {\n\tmargin:0;\n}\n.single-media .upload-kit-item.image > img {\n height: 100%;\n width: 100%;\n border-radius: 7px;\n}\n\n "); $this->getView()->registerJs("jQuery('#{$this->options['id']}').attachmentUpload({$options});"); }
/** * Registers required script for the plugin to work as jQuery File Uploader */ public function registerClientScript() { Html::addCssClass($this->wrapperOptions, " upload-kit"); AttachmentUploadAsset::register($this->getView()); if ($this->sortable) { JuiAsset::register($this->getView()); } $options = Json::encode($this->clientOptions); $this->getView()->registerJs("jQuery('#{$this->options['id']}').attachmentUpload({$options});"); }