Support icon feature for taglist widget

This commit is contained in:
Hadi Nategh 2018-06-22 15:06:53 +02:00
parent ed8c26bd08
commit 263cba6bf1
2 changed files with 32 additions and 2 deletions

View File

@ -548,7 +548,16 @@ var et2_taglist = (function(){ "use strict"; return et2_selectbox.extend([et2_IR
{
var label = jQuery('<span>').text(item.label);
if (typeof item.title != 'undefined') label.attr('title', item.title);
if (typeof item.icon != 'undefined')
{
var wrapper = jQuery('<div>').addClass('et2_taglist_tags_icon_wrapper');
jQuery('<span/>')
.addClass('et2_taglist_tags_icon')
.css({"background-image": "url("+(item.icon.match(/^(http|https|\/)/) ? item.icon : egw.image(item.icon))+")"})
.appendTo(wrapper);
label.appendTo(wrapper);
return wrapper;
}
return label;
},
@ -1225,7 +1234,16 @@ var et2_taglist_email = (function(){ "use strict"; return et2_taglist.extend(
},this),1);
return null;
}
if (typeof item.icon != 'undefined' && item.icon)
{
var wrapper = jQuery('<div>').addClass('et2_taglist_tags_icon_wrapper');
jQuery('<span/>')
.addClass('et2_taglist_tags_icon')
.css({"background-image": "url("+(item.icon.match(/^(http|https|\/)/) ? item.icon : egw.image(item.icon))+")"})
.appendTo(wrapper);
label.appendTo(wrapper);
return wrapper;
}
return label;
}
});}).call(this);

View File

@ -1097,6 +1097,18 @@ ul.et2_link_string {
.et2_taglist, .et2_taglist > div.ms-ctn {
min-height: 23px;
}
.et2_taglist .et2_taglist_tags_icon {
height: 16px;
width: 16px;
display: inline-block;
padding-right: 3px;
background-repeat: no-repeat;
background-size: 16px;
vertical-align: text-top;
}
.et2_taglist .et2_taglist_tags_icon_wrapper {
display: inline;
}
.et2_taglist_thumbnail {
overflow-y: hidden;
}