Skip to content

Commit 9449a66

Browse files
committed
Dynamicly load icon into mock button HTML
1 parent 09b5cb1 commit 9449a66

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

generators/app/templates/app/addin.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ <h2 class="panel__title"><%= title %></h2>
4444
<div class="checkmateFormPage">
4545
<div class="checkmateToolbarContainer">
4646
<span class="checkmateToolbar">
47-
<button class="geotabButton customButton noTranslate"><span class="icon" style="background-image: url(images/icon.svg)"></span><%= title %></button>
47+
<button class="geotabButton customButton noTranslate"><span class="icon" {icon}></span><%= title %></button>
4848
</div>
4949
</div>
5050
<% } else { %>

generators/app/templates/gulpfile.babel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ let mockAddinHost = sourceDir => {
153153

154154
if (parsed.pathname === '/' || parsed.pathname.indexOf(config.dev.root + '.html') > -1) {
155155
if (isButton) {
156-
htmlSource = fs.readFileSync('.dev/button.html', 'utf8');
156+
htmlSource = fs.readFileSync('.dev/button.html', 'utf8').replace('{icon}', `style="background-image: url(${config.items[0].icon})"` || '');
157157
} else {
158158
htmlSource = fs.readFileSync(parsed.pathname === '/' ? `${sourceDir}/${config.dev.root}.html` : parsed.pathname, 'utf8');
159159
}

0 commit comments

Comments
 (0)