Fix for custom CSS classes in the widget

v.1.7.1
This commit is contained in:
adi 2017-01-16 20:52:31 +01:00
parent d915284e41
commit 87933b55e7
3 changed files with 9 additions and 4 deletions

View file

@ -327,6 +327,10 @@ $('.markdownx').on('markdownx.update', function(e, response) {
# Changelog
###### v1.7.1
* Fix for custom CSS classes in the widget
###### v1.7
* SVG file upload support

View file

@ -12,9 +12,10 @@ from .settings import (
class MarkdownxWidget(forms.Textarea):
def render(self, name, value, attrs=None):
if attrs is None:
attrs = {}
elif 'class' in attrs:
attrs = self.build_attrs(attrs, name=name)
print(attrs)
if 'class' in attrs:
attrs['class'] += ' markdownx-editor'
else:
attrs.update({'class':'markdownx-editor'})

View file

@ -10,7 +10,7 @@ def get_requirements():
setup(
name='django-markdownx',
version='1.7',
version='1.7.1',
packages=find_packages(),
include_package_data=True,
description='django-markdownx is a Markdown editor built for Django.',