mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-11 12:11:19 +00:00
place button with color of category in front of title in select menu
This commit is contained in:
parent
9e6e13a041
commit
05c0f296fc
|
@ -150,7 +150,8 @@ $(document).ready( function() {
|
|||
$options[] = array("-1", getMLText("choose_category"));
|
||||
$options[] = array("0", getMLText("new_document_category"));
|
||||
foreach ($categories as $category) {
|
||||
$options[] = array($category->getID(), htmlspecialchars($category->getName()), $selcat && $category->getID()==$selcat->getID(), array(array('data-subtitle', $category->countDocumentsByCategory().' '.getMLText('documents'))));
|
||||
$color = substr(md5($category->getName()), 0, 6);
|
||||
$options[] = array($category->getID(), htmlspecialchars($category->getName()), $selcat && $category->getID()==$selcat->getID(), array(array('data-before-title', "<i class='fa fa-circle' style='color: #".$color.";'></i> "), array('data-subtitle', $category->countDocumentsByCategory().' '.getMLText('documents'))));
|
||||
}
|
||||
$this->formField(
|
||||
null, //getMLText("selection"),
|
||||
|
|
|
@ -12,6 +12,8 @@ chzn_template_func = function (state) {
|
|||
if($(state.element).data('warning'))
|
||||
warning = $(state.element).data('warning')+''; /* make sure it is a string */
|
||||
var html = '<span>';
|
||||
if($(state.element).data('before-title'))
|
||||
html += $(state.element).data('before-title')+'';
|
||||
if($(state.element).data('icon-before'))
|
||||
html += '<i class="fa fa-'+$(state.element).data('icon-before')+'"></i> ';
|
||||
html += state.text.replace(/</g, '<')+'';
|
||||
|
|
|
@ -12,6 +12,8 @@ chzn_template_func = function (state) {
|
|||
if($(state.element).data('warning'))
|
||||
warning = $(state.element).data('warning')+''; /* make sure it is a string */
|
||||
var html = '<span>';
|
||||
if($(state.element).data('before-title'))
|
||||
html += $(state.element).data('before-title')+'';
|
||||
if($(state.element).data('icon-before'))
|
||||
html += '<i class="fa fa-'+$(state.element).data('icon-before')+'"></i> ';
|
||||
html += state.text.replace(/</g, '<')+'';
|
||||
|
|
Loading…
Reference in New Issue
Block a user