Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ snapshots
.nyc_output
.coverage
.karma
dist
*.browser.json
*.marko.js
.browser-refresh
integration/template.marko
Expand Down
13 changes: 7 additions & 6 deletions dist/components/ebay-icon/index.marko
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
var getWidgetId = require("../../common/get-marko-3-widget-id");
var processHtmlAttributes = require("../../common/html-attributes");
var isBrowser = typeof window !== "undefined";
var defined = isBrowser ? (window.$ebayIcons = window.$ebayIcons || {}) : {};
var browserLookup = {};
</script>

<var lookup=(isBrowser ? browserLookup : out.global)/>
<var isInline=(data.type === "inline")/>
<var a11yAttributes/>
<var titleId/>
Expand All @@ -30,12 +31,12 @@
${a11yAttributes}>
<if(isInline)>
<!-- Here we check if we should render the inline svg symbol. -->
<!-- Server side we store a flag in `out` to check if the symbol was rendered. -->
<!-- Client side we check the `defined` object to see if the symbol is already present in root svg. -->
<!-- Server side we store a flag in `out.global` to check if the symbol was rendered. -->
<!-- Client side we check the `browserLookup` object to see if the symbol is already present in root svg. -->
<var themes=data._themes/>
<var lookupName="rendered_ebay_icon_${data.name}"/>
<var renderDefs=(!out[lookupName] && !defined[lookupName])/>
<assign out[lookupName]=true/>
<var lookupName=("rendered_ebay_icon_" + data.name)/>
<var renderDefs=!lookup[lookupName]/>
<assign lookup[lookupName]=true/>

<if(renderDefs && themes)>
<defs w-id="defs">
Expand Down
6 changes: 1 addition & 5 deletions dist/components/ebay-icon/widget.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';var defined = window.$ebayIcons = window.$ebayIcons || {};
var rootSvg = void 0;
'use strict';var rootSvg = void 0;

module.exports = require('marko-widgets').defineWidget({
init: function init() {
Expand All @@ -18,9 +17,6 @@ module.exports = require('marko-widgets').defineWidget({
defs.parentNode.removeChild(defs);

if (symbol) {
// Here we get the name of the symbol by removing the `icon-` part.
// We then mark this symbol as `defined` so that no other `ebay-icons` render it.
defined['rendered_ebay_icon_' + symbol.id.slice(5)] = true;
rootSvg.appendChild(symbol);
}
}
Expand Down
2 changes: 1 addition & 1 deletion dist/components/ebay-menu/template.marko
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
aria-label=data.a11yText
disabled=data.disabled
w-on-button-escape="handleButtonEscape">
<span class="expand-btn__cell ${data.customLabel ? 'custom_label' : ''}">
<span class=['expand-btn__cell', (data.customLabel && 'menu__control--custom-label')]>
<if(data.customLabel)>
<span w-body=data.customLabel body-only-if(true)/>
</if>
Expand Down
5 changes: 5 additions & 0 deletions ebay-badge.browser.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": [
"./dist/components/ebay-badge"
]
}
5 changes: 5 additions & 0 deletions ebay-breadcrumb.browser.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": [
"./dist/components/ebay-breadcrumb"
]
}
5 changes: 5 additions & 0 deletions ebay-button.browser.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": [
"./dist/components/ebay-button"
]
}
5 changes: 5 additions & 0 deletions ebay-carousel.browser.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": [
"./dist/components/ebay-carousel"
]
}
5 changes: 5 additions & 0 deletions ebay-checkbox.browser.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": [
"./dist/components/ebay-checkbox"
]
}
5 changes: 5 additions & 0 deletions ebay-combobox-readonly.browser.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": [
"./dist/components/ebay-combobox-readonly"
]
}
5 changes: 5 additions & 0 deletions ebay-combobox.browser.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": [
"./dist/components/ebay-combobox"
]
}
5 changes: 5 additions & 0 deletions ebay-dialog.browser.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": [
"./dist/components/ebay-dialog"
]
}
5 changes: 5 additions & 0 deletions ebay-icon.browser.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": [
"./dist/components/ebay-icon"
]
}
5 changes: 5 additions & 0 deletions ebay-infotip.browser.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": [
"./dist/components/ebay-infotip"
]
}
5 changes: 5 additions & 0 deletions ebay-listbox.browser.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": [
"./dist/components/ebay-listbox"
]
}
5 changes: 5 additions & 0 deletions ebay-menu.browser.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": [
"./dist/components/ebay-menu"
]
}
5 changes: 5 additions & 0 deletions ebay-notice.browser.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": [
"./dist/components/ebay-notice"
]
}
5 changes: 5 additions & 0 deletions ebay-pagination.browser.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": [
"./dist/components/ebay-pagination"
]
}
5 changes: 5 additions & 0 deletions ebay-pill.browser.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": [
"./dist/components/ebay-pill"
]
}
5 changes: 5 additions & 0 deletions ebay-radio.browser.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": [
"./dist/components/ebay-radio"
]
}
5 changes: 5 additions & 0 deletions ebay-select.browser.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": [
"./dist/components/ebay-select"
]
}
5 changes: 5 additions & 0 deletions ebay-switch.browser.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": [
"./dist/components/ebay-switch"
]
}
5 changes: 5 additions & 0 deletions ebay-tab.browser.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": [
"./dist/components/ebay-tab"
]
}
5 changes: 5 additions & 0 deletions ebay-textbox.browser.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": [
"./dist/components/ebay-textbox"
]
}
5 changes: 5 additions & 0 deletions ebay-tooltip.browser.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": [
"./dist/components/ebay-tooltip"
]
}
5 changes: 5 additions & 0 deletions ebay-tourtip.browser.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": [
"./dist/components/ebay-tourtip"
]
}