Skip to content

Commit

Permalink
Merge pull request #25 from ogtony/master
Browse files Browse the repository at this point in the history
  • Loading branch information
omji authored Jul 2, 2018
2 parents bc49520 + 8bac5bf commit 05f35e2
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions tabbed_admin/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,26 +137,14 @@ def change_view(self, request, object_id, form_url='', extra_context=None):
)
return change_view

@property
def media(self):
class Media:
"""
Overrides media class to add custom jquery ui if
Extends media class to add custom jquery ui if
TABBED_ADMIN_USE_JQUERY_UI is set to True.
"""
media = super(TabbedModelAdmin, self).media
css = {'all': ()}
js = []

if 'grappelli' in settings.INSTALLED_APPS:
css['all'] = ("tabbed_admin/css/tabbed_grappelli_admin.css", ) + css['all']
media.add_css(css)
css = {'all': ("tabbed_admin/css/tabbed_grappelli_admin.css", )}

if USE_JQUERY_UI:
css['all'] = (
JQUERY_UI_CSS,
'tabbed_admin/css/tabbed_admin.css', ) + css.get('all', ())
js = [JQUERY_UI_JS]

media.add_css(css)
media.add_js(js)
return media
css = {'all': (JQUERY_UI_CSS, 'tabbed_admin/css/tabbed_admin.css', )}
js = (JQUERY_UI_JS,)

0 comments on commit 05f35e2

Please sign in to comment.