mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-26 10:45:14 +02:00
Started adding a badge-icon directive.
This commit is contained in:
@@ -0,0 +1,13 @@
|
|||||||
|
module.exports = function badgeIconDirective() {
|
||||||
|
return {
|
||||||
|
restrict: 'EA',
|
||||||
|
replace: true,
|
||||||
|
scope: {
|
||||||
|
|
||||||
|
},
|
||||||
|
template: require('./badge-icon.jade'),
|
||||||
|
link: function (scope, element, attrs) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
describe('badgeIcon', function () {
|
||||||
|
|
||||||
|
beforeEach(module('stf.badge-icon'));
|
||||||
|
|
||||||
|
var scope, compile;
|
||||||
|
|
||||||
|
beforeEach(inject(function ($rootScope, $compile) {
|
||||||
|
scope = $rootScope.$new();
|
||||||
|
compile = $compile;
|
||||||
|
}));
|
||||||
|
|
||||||
|
it('should ...', function () {
|
||||||
|
|
||||||
|
/*
|
||||||
|
To test your directive, you need to create some html that would use your directive,
|
||||||
|
send that through compile() then compare the results.
|
||||||
|
|
||||||
|
var element = compile('<div badge-icon name="name">hi</div>')(scope);
|
||||||
|
expect(element.text()).toBe('hello, world');
|
||||||
|
*/
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
.stf-badge-icon {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.stf-badge-icon .stf-badge-icon-warning {
|
||||||
|
color: #fec42d;
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
div.stf-badge-icon
|
||||||
|
//i.fa.fa-warning.stf-badge-icon-warning(popover='I appeared on mouse enter!', popover-placement='bottom', popover-trigger='mouseenter')
|
||||||
|
i.fa.fa-warning.stf-badge-icon-warning(tooltip-placement='bottom', tooltip='An error has ocurred')
|
||||||
6
res/app/components/stf/common-ui/badge-icon/index.js
Normal file
6
res/app/components/stf/common-ui/badge-icon/index.js
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
require('./badge-icon.css')
|
||||||
|
|
||||||
|
module.exports = angular.module('stf.badge-icon', [
|
||||||
|
|
||||||
|
])
|
||||||
|
.directive('badgeIcon', require('./badge-icon-directive'))
|
||||||
@@ -11,5 +11,6 @@ module.exports = angular.module('stf/common-ui', [
|
|||||||
require('./modals').name,
|
require('./modals').name,
|
||||||
require('./include-cached').name,
|
require('./include-cached').name,
|
||||||
require('./text-focus-select').name,
|
require('./text-focus-select').name,
|
||||||
require('./counter').name
|
require('./counter').name,
|
||||||
|
require('./badge-icon').name
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -21,6 +21,11 @@
|
|||||||
a(ng-click='openChat()').pointer
|
a(ng-click='openChat()').pointer
|
||||||
i.fa.fa-comment.fa-fw
|
i.fa.fa-comment.fa-fw
|
||||||
| {{ "Chat" | translate }}
|
| {{ "Chat" | translate }}
|
||||||
|
|
||||||
|
//li
|
||||||
|
a
|
||||||
|
badge-icon(type='warning', message='There was an error')
|
||||||
|
|
||||||
li(ng-if='!$root.basicMode')
|
li(ng-if='!$root.basicMode')
|
||||||
a(ng-href='/#!/help')
|
a(ng-href='/#!/help')
|
||||||
i.fa.fa-question-circle.fa-fw
|
i.fa.fa-question-circle.fa-fw
|
||||||
|
|||||||
Reference in New Issue
Block a user