Font Awesome icons in header

https://fedorahosted.org/freeipa/ticket/3904
This commit is contained in:
Petr Vobornik 2013-11-05 19:12:51 +01:00 committed by Martin Kosek
parent 40ad71726e
commit 4bc1942f53
4 changed files with 21 additions and 9 deletions

View File

@ -1,7 +1,7 @@
// Variables
// --------------------------
@fa-font-path: "../fonts";
@fa-font-path: "../font";
//@fa-font-path: "//netdna.bootstrapcdn.com/font-awesome/4.0.3/fonts"; // for referencing Bootstrap CDN font files directly
@fa-css-prefix: fa;
@fa-version: "4.0.3";

View File

@ -3681,7 +3681,7 @@ IPA.button = function(spec) {
if (spec.icon) {
$('<span/>', {
'class': 'icon '+spec.icon
'class': 'fa '+spec.icon
}).appendTo(button);
}

View File

@ -80,7 +80,7 @@ define(['dojo/_base/declare',
_fullnameSetter: function(value) {
this.fullname = value;
if (this.logged_user_node) {
prop.set(this.logged_user_node, 'textContent', value);
prop.set(this.logged_user_node, 'textContent', ' '+ value);
}
},
@ -170,7 +170,7 @@ define(['dojo/_base/declare',
var nodes = [];
nodes.push(construct.create('span', {
'class': 'icon-user icon-white'
'class': 'fa fa-user'
}));
this.logged_user_node = construct.create('span', {
@ -205,18 +205,21 @@ define(['dojo/_base/declare',
items: [
{
name: 'profile',
label: 'Profile'
label: 'Profile',
icon: 'fa-user'
},
{
name: 'password_reset',
label: 'Change password'
label: 'Change password',
icon: 'fa-key'
},
{
'class': 'divider'
},
{
name: 'logout',
label: 'Logout'
label: 'Logout',
icon: 'fa-sign-out'
}
]
});

View File

@ -173,11 +173,20 @@ define(['dojo/_base/declare',
var li = construct.create('li', {
'data-name': item.name || ''
});
var a = construct.create('a', {
'href': '#' + item.name || '',
innerHTML: item.label || ''
'href': '#' + item.name || ''
}, li);
if (item.icon) {
construct.create('i', {
'class': 'fa ' + item.icon
}, a);
}
var text = document.createTextNode(' '+item.label || '');
construct.place(text, a);
if (item['class']) {
dom_class.add(li, item['class']);
}