Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

htmlOptions is overwritten #1

Closed
pjacquemin opened this issue Dec 17, 2014 · 3 comments
Closed

htmlOptions is overwritten #1

pjacquemin opened this issue Dec 17, 2014 · 3 comments

Comments

@pjacquemin
Copy link
Contributor

Hi,

I think that there is a bug in your code.
The $htmlOptions is initialized with the dropzone class at top of DropZone.php :
$htmlOptions = [
'class' => 'dropzone',
];

When using public htmlOptions with the widget, $htmlOptions is overwritten in DropZone.php and the dropzone class option doesnt exists anymore.

You should declare the dropzone class like this in init() or in run() :
$this->htmlOptions['class'] = $this->htmlOptions['class'] . ' dropzone';

Have a nice day and thank you for your sharing.

pjacquemin added a commit to pjacquemin/yii2-dropzone that referenced this issue Dec 17, 2014
@evgen-d
Copy link
Contributor

evgen-d commented Dec 17, 2014

Hi. I think that better will be used Html::addClass
You can fix it by pull request now, or I'll fix it later

@pjacquemin
Copy link
Contributor Author

I have not found Html::addClass
I propose you a last working commit.

@Philosoft
Copy link

@pjacquemin may be @evgen-d means Html::addCssClass

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

No branches or pull requests

3 participants