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 // 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-font-path: "//netdna.bootstrapcdn.com/font-awesome/4.0.3/fonts"; // for referencing Bootstrap CDN font files directly
@fa-css-prefix: fa; @fa-css-prefix: fa;
@fa-version: "4.0.3"; @fa-version: "4.0.3";

View File

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

View File

@ -80,7 +80,7 @@ define(['dojo/_base/declare',
_fullnameSetter: function(value) { _fullnameSetter: function(value) {
this.fullname = value; this.fullname = value;
if (this.logged_user_node) { 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 = []; var nodes = [];
nodes.push(construct.create('span', { nodes.push(construct.create('span', {
'class': 'icon-user icon-white' 'class': 'fa fa-user'
})); }));
this.logged_user_node = construct.create('span', { this.logged_user_node = construct.create('span', {
@ -205,18 +205,21 @@ define(['dojo/_base/declare',
items: [ items: [
{ {
name: 'profile', name: 'profile',
label: 'Profile' label: 'Profile',
icon: 'fa-user'
}, },
{ {
name: 'password_reset', name: 'password_reset',
label: 'Change password' label: 'Change password',
icon: 'fa-key'
}, },
{ {
'class': 'divider' 'class': 'divider'
}, },
{ {
name: 'logout', 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', { var li = construct.create('li', {
'data-name': item.name || '' 'data-name': item.name || ''
}); });
var a = construct.create('a', { var a = construct.create('a', {
'href': '#' + item.name || '', 'href': '#' + item.name || ''
innerHTML: item.label || ''
}, li); }, 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']) { if (item['class']) {
dom_class.add(li, item['class']); dom_class.add(li, item['class']);
} }