Skip to content

Commit

Permalink
EZP-27246: Content type Description field appears on content-in-the-f…
Browse files Browse the repository at this point in the history
…ly, even if the description is empty
  • Loading branch information
dew326 committed Apr 13, 2017
1 parent 0628a14 commit 6f96360
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions bundle/Resources/public/js/views/cof-contenttypeselectorview.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,17 +119,23 @@ YUI.add('cof-contenttypeselectorview', function (Y) {
* @param show {Boolean} should show the tooltip?
*/
_toggleTooltip: function (show) {
var methodName = show ? 'removeClass' : 'addClass',
container = this.get('container'),
var container = this.get('container'),
selectedItem = container.one(SELECTOR_ITEM_SELECTED),
tooltip = container.one(SELECTOR_TOOLTIP);
tooltip = container.one(SELECTOR_TOOLTIP),
methodName,
description;

if (selectedItem) {
tooltip.setHTML(selectedItem.getAttribute(ATTR_DESCRIPTION));

tooltip[methodName](CLASS_HIDDEN);
tooltip.removeClass(CLASS_TOOLTIP_ERROR);
if (!selectedItem) {
return;
}

description = selectedItem.getAttribute(ATTR_DESCRIPTION);
methodName = show && !!description ? 'removeClass' : 'addClass';

tooltip.setHTML(description);

tooltip[methodName](CLASS_HIDDEN);
tooltip.removeClass(CLASS_TOOLTIP_ERROR);
},

/**
Expand Down

0 comments on commit 6f96360

Please sign in to comment.