Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
joshine
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
joshine
Commits
9c8923a8
Commit
9c8923a8
authored
Jul 05, 2023
by
liumengfei
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' into production
parents
46a7b746
6ea330bc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
21 deletions
+11
-21
app/design/frontend/Joshine/breeze/Magento_Swatches/web/js/swatch-renderer.js
+11
-21
No files found.
app/design/frontend/Joshine/breeze/Magento_Swatches/web/js/swatch-renderer.js
View file @
9c8923a8
...
@@ -543,34 +543,28 @@ define([
...
@@ -543,34 +543,28 @@ define([
if
(
!
this
.
hasOwnProperty
(
'products'
)
||
this
.
products
.
length
<=
0
)
{
if
(
!
this
.
hasOwnProperty
(
'products'
)
||
this
.
products
.
length
<=
0
)
{
attr
+=
' data-option-empty="true"'
;
attr
+=
' data-option-empty="true"'
;
}
}
var
selectedStr
=
''
;
if
(
index
==
0
)
{
selectedStr
=
' selected'
;
}
if
(
type
===
0
)
{
if
(
type
===
0
)
{
// Text
// Text
html
+=
'<div class="'
+
optionClass
+
' text'
+
'" '
+
attr
+
'>'
+
(
value
?
value
:
label
)
+
html
+=
'<div class="'
+
optionClass
+
' text'
+
selectedStr
+
'" '
+
attr
+
'>'
+
(
value
?
value
:
label
)
+
'</div>'
;
'</div>'
;
}
else
if
(
type
===
1
)
{
}
else
if
(
type
===
1
)
{
// Color
// Color
html
+=
'<div class="'
+
optionClass
+
' color'
+
selectedStr
+
'" '
+
attr
+
html
+=
'<div class="'
+
optionClass
+
' color'
+
'" '
+
attr
+
' style="background: '
+
value
+
' style="background: '
+
value
+
' no-repeat center; background-size: cover;">'
+
''
+
' no-repeat center; background-size: cover;">'
+
''
+
'</div>'
;
'</div>'
;
}
else
if
(
type
===
2
)
{
}
else
if
(
type
===
2
)
{
// Image
// Image
html
+=
'<div class="'
+
optionClass
+
' image'
+
selectedStr
+
'" '
+
attr
+
html
+=
'<div class="'
+
optionClass
+
' image'
+
'" '
+
attr
+
' style="background: url('
+
value
+
') no-repeat center; background-size: cover;width:'
+
' style="background: url('
+
value
+
') no-repeat center; background-size: cover;width:'
+
swatchImageWidth
+
'px; height:'
+
swatchImageHeight
+
'px">'
+
''
+
swatchImageWidth
+
'px; height:'
+
swatchImageHeight
+
'px">'
+
''
+
'</div>'
;
'</div>'
;
}
else
if
(
type
===
3
)
{
}
else
if
(
type
===
3
)
{
// Clear
// Clear
html
+=
'<div class="'
+
optionClass
+
selectedStr
+
'" '
+
attr
+
'></div>'
;
html
+=
'<div class="'
+
optionClass
+
'" '
+
attr
+
'></div>'
;
}
else
{
}
else
{
// Default
// Default
html
+=
'<div class="'
+
optionClass
+
selectedStr
+
'" '
+
attr
+
'>'
+
label
+
'</div>'
;
html
+=
'<div class="'
+
optionClass
+
'" '
+
attr
+
'>'
+
label
+
'</div>'
;
}
}
});
});
...
@@ -800,34 +794,30 @@ define([
...
@@ -800,34 +794,30 @@ define([
if
(
!
this
.
hasOwnProperty
(
'products'
)
||
this
.
products
.
length
<=
0
)
{
if
(
!
this
.
hasOwnProperty
(
'products'
)
||
this
.
products
.
length
<=
0
)
{
attr
+=
' data-option-empty="true"'
;
attr
+=
' data-option-empty="true"'
;
}
}
var
selectedStr
=
''
;
if
(
index
==
0
)
{
selectedStr
=
' selected'
;
}
if
(
type
===
0
)
{
if
(
type
===
0
)
{
// Text
// Text
html
+=
'<div class="'
+
optionClass
+
' text'
+
selectedStr
+
'" '
+
attr
+
'>'
+
(
value
?
value
:
label
)
+
html
+=
'<div class="'
+
optionClass
+
' text'
+
'" '
+
attr
+
'>'
+
(
value
?
value
:
label
)
+
'</div>'
;
'</div>'
;
}
else
if
(
type
===
1
)
{
}
else
if
(
type
===
1
)
{
// Color
// Color
html
+=
'<div class="'
+
optionClass
+
' color'
+
selectedStr
+
'" '
+
attr
+
html
+=
'<div class="'
+
optionClass
+
' color'
+
'" '
+
attr
+
' style="background: '
+
value
+
' style="background: '
+
value
+
' no-repeat center; background-size: cover;">'
+
''
+
' no-repeat center; background-size: cover;">'
+
''
+
'</div>'
;
'</div>'
;
}
else
if
(
type
===
2
)
{
}
else
if
(
type
===
2
)
{
// Image
// Image
html
+=
'<div class="'
+
optionClass
+
' image'
+
selectedStr
+
'" '
+
attr
+
html
+=
'<div class="'
+
optionClass
+
' image'
+
'" '
+
attr
+
' style="background: url('
+
value
+
') no-repeat center; background-size: cover;width:'
+
' style="background: url('
+
value
+
') no-repeat center; background-size: cover;width:'
+
swatchImageWidth
+
'px; height:'
+
swatchImageHeight
+
'px">'
+
''
+
swatchImageWidth
+
'px; height:'
+
swatchImageHeight
+
'px">'
+
''
+
'</div>'
;
'</div>'
;
}
else
if
(
type
===
3
)
{
}
else
if
(
type
===
3
)
{
// Clear
// Clear
html
+=
'<div class="'
+
optionClass
+
selectedStr
+
'" '
+
attr
+
'></div>'
;
html
+=
'<div class="'
+
optionClass
+
'" '
+
attr
+
'></div>'
;
}
else
{
}
else
{
// Default
// Default
html
+=
'<div class="'
+
optionClass
+
selectedStr
+
'" '
+
attr
+
'>'
+
label
+
'</div>'
;
html
+=
'<div class="'
+
optionClass
+
'" '
+
attr
+
'>'
+
label
+
'</div>'
;
}
}
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment