Permalink
Browse files

(Partially) fixed #940 by handling non-existing icons better

  • Loading branch information...
1 parent e22acbd commit 64a81b5438a05aae4e8d25031c8c7e083359a4d3 Jonas Obrist committed Aug 14, 2011
Showing with 2 additions and 3 deletions.
  1. +2 −3 cms/static/cms/js/plugins/cms.toolbar.js
@@ -293,7 +293,7 @@ jQuery(document).ready(function ($) {
// lets loop through the items
$(obj.items).each(function (index, value) {
// add icon if available
- var icon = (value.icon !== '') ? 'cms_toolbar_icon cms_toolbar_icon-enabled ' : '';
+ var icon = value.icon ? 'cms_toolbar_icon cms_toolbar_icon-enabled ' : '';
// replace attributes
tmp += list.replace('[list_title]', value.title)
.replace('[list_url]', value.url)
@@ -389,8 +389,7 @@ jQuery(document).ready(function ($) {
// back to jquery object
template = $(template);
if(obj.cls) template.addClass(obj.cls);
- // TODO: backend should return '' or undefined instead of /media/
- if(obj.icon && obj.icon !== '/media/') {
+ if (obj.icon) {
template.find('.cms_toolbar-btn_right .toolbar_icon-prefix')
.addClass('cms_toolbar_icon-enabled')
.css('background-image', 'url('+obj.icon+')');

0 comments on commit 64a81b5

Please sign in to comment.