Skip to content

Commit

Permalink
if weather or icofont icons loaded externally use them
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Conway-Jones committed Dec 20, 2016
1 parent a3c6e24 commit e7f0199
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
- Fix colour-picker touch support (upstream fix)
- Fix slight transparency issue on select dropdown
- Small changes to colour-picker styling

- Allow use of wi and icofont icon families (only if loaded externally vi ui_template)

### 2.2.0: Milestone Release

Expand Down
2 changes: 1 addition & 1 deletion dist/dashboard.appcache
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ fonts/fontawesome-webfont.woff2
NETWORK:
*

# hash: 6b2f5a904c3bf4a69926e8fe512b3c83a7367a8244ae507a58abfbedd9ce6779
# hash: 05e3eb73ef90b98ed73dc8a192579a1a00b110ce447e37d64f6ef8b6e9d0e1e5
4 changes: 2 additions & 2 deletions dist/js/app.min.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/components/ui-icon/ui-icon.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<ng-md-icon ng-if="iconType==='angular-material'" icon="{{icon}}"></ng-md-icon>
<div ng-if="iconType==='fa'" style="font-size:1.17em; display:inline-block; margin:auto;"><i class="fa fa-fw" ng-class="icon"></i></div>
<div ng-if="iconType==='wi'" style="font-size:1.17em; display:inline-block; margin:auto;"><i class="wi wi-fw" ng-class="icon"></i></div>
<div ng-if="iconType==='icofont'" style="font-size:1.17em; display:inline-block; margin:auto;"><i class="icofont icofont-fw" ng-class="icon"></i></div>
<img ng-if="iconType==='image'" ng-src="{{url}}" style="width:24px; display:block; margin:auto;"></img>
8 changes: 7 additions & 1 deletion src/components/ui-icon/ui-icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ angular.module('ui').directive('uiIcon',
function () {
var url = /^https?:\/\//i;
var fa = /^fa-/i;
var wi = /^wi-/i;
var ic = /^icofont-/i;
return {
restrict: 'E',
templateUrl: 'components/ui-icon/ui-icon.html',
Expand All @@ -17,10 +19,14 @@ angular.module('ui').directive('uiIcon',
scope.url = newValue;
} else if (fa.test(newValue)) {
scope.iconType = 'fa';
} else if (wi.test(newValue)) {
scope.iconType = 'wi';
} else if (ic.test(newValue)) {
scope.iconType = 'icofont';
} else {
scope.iconType = 'angular-material';
}
});
}
};
});
});

0 comments on commit e7f0199

Please sign in to comment.