Updated big-icon test page to all built-in glyphs to be accessed also.
Change-Id: If2745df6aa2839850d4a82cb7f8b5c5fb9ef5791
Showing
2 changed files
with
12 additions
and
9 deletions
| ... | @@ -53,12 +53,14 @@ | ... | @@ -53,12 +53,14 @@ |
| 53 | color: darkred; | 53 | color: darkred; |
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | + /* foreground color */ | ||
| 56 | svg .glyph { | 57 | svg .glyph { |
| 57 | stroke: none; | 58 | stroke: none; |
| 58 | - fill: #123456; | 59 | + fill: #246; |
| 59 | fill-rule: evenodd; | 60 | fill-rule: evenodd; |
| 60 | } | 61 | } |
| 61 | 62 | ||
| 63 | + /* background color */ | ||
| 62 | svg.embeddedGlyph .glyph rect { | 64 | svg.embeddedGlyph .glyph rect { |
| 63 | fill: #fff | 65 | fill: #fff |
| 64 | } | 66 | } | ... | ... |
| ... | @@ -137,12 +137,6 @@ | ... | @@ -137,12 +137,6 @@ |
| 137 | smiley: smiley | 137 | smiley: smiley |
| 138 | }; | 138 | }; |
| 139 | 139 | ||
| 140 | - var gids = [ | ||
| 141 | - 'alarm', | ||
| 142 | - 'alarms', | ||
| 143 | - 'smiley' | ||
| 144 | - ]; | ||
| 145 | - | ||
| 146 | angular.module('showGlyph', ['onosSvg']) | 140 | angular.module('showGlyph', ['onosSvg']) |
| 147 | .controller('OvShowGlyph', ['$log', 'GlyphService', | 141 | .controller('OvShowGlyph', ['$log', 'GlyphService', |
| 148 | 142 | ||
| ... | @@ -150,9 +144,16 @@ | ... | @@ -150,9 +144,16 @@ |
| 150 | var gDiv = d3.select('#showGlyphs'), | 144 | var gDiv = d3.select('#showGlyphs'), |
| 151 | defs = d3.select('defs'); | 145 | defs = d3.select('defs'); |
| 152 | 146 | ||
| 147 | + // register out-of-the-box glyphs | ||
| 148 | + gs.init(); | ||
| 149 | + | ||
| 150 | + // register our custom glyphs | ||
| 153 | gs.registerGlyphSet(glyphData); | 151 | gs.registerGlyphSet(glyphData); |
| 154 | - gs.loadDefs(defs, gids); | ||
| 155 | 152 | ||
| 156 | - createGlyph(gDiv, 400, 'smiley'); | 153 | + // load all defined glyphs into our <defs> element |
| 154 | + gs.loadDefs(defs); | ||
| 155 | + | ||
| 156 | + // choose a glyph to render | ||
| 157 | + createGlyph(gDiv, 400, 'switch'); | ||
| 157 | }]); | 158 | }]); |
| 158 | }()); | 159 | }()); | ... | ... |
-
Please register or login to post a comment