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
6ea330bc
Commit
6ea330bc
authored
Jul 05, 2023
by
liumengfei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
产品详情默认打开关闭属性选中
parent
ac48c2c7
Show 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 @
6ea330bc
...
...
@@ -543,34 +543,28 @@ define([
if
(
!
this
.
hasOwnProperty
(
'products'
)
||
this
.
products
.
length
<=
0
)
{
attr
+=
' data-option-empty="true"'
;
}
var
selectedStr
=
''
;
if
(
index
==
0
)
{
selectedStr
=
' selected'
;
}
if
(
type
===
0
)
{
// Text
html
+=
'<div class="'
+
optionClass
+
' text'
+
selectedStr
+
'" '
+
attr
+
'>'
+
(
value
?
value
:
label
)
+
html
+=
'<div class="'
+
optionClass
+
' text'
+
'" '
+
attr
+
'>'
+
(
value
?
value
:
label
)
+
'</div>'
;
}
else
if
(
type
===
1
)
{
// Color
html
+=
'<div class="'
+
optionClass
+
' color'
+
selectedStr
+
'" '
+
attr
+
html
+=
'<div class="'
+
optionClass
+
' color'
+
'" '
+
attr
+
' style="background: '
+
value
+
' no-repeat center; background-size: cover;">'
+
''
+
'</div>'
;
}
else
if
(
type
===
2
)
{
// 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:'
+
swatchImageWidth
+
'px; height:'
+
swatchImageHeight
+
'px">'
+
''
+
'</div>'
;
}
else
if
(
type
===
3
)
{
// Clear
html
+=
'<div class="'
+
optionClass
+
selectedStr
+
'" '
+
attr
+
'></div>'
;
html
+=
'<div class="'
+
optionClass
+
'" '
+
attr
+
'></div>'
;
}
else
{
// Default
html
+=
'<div class="'
+
optionClass
+
selectedStr
+
'" '
+
attr
+
'>'
+
label
+
'</div>'
;
html
+=
'<div class="'
+
optionClass
+
'" '
+
attr
+
'>'
+
label
+
'</div>'
;
}
});
...
...
@@ -800,34 +794,30 @@ define([
if
(
!
this
.
hasOwnProperty
(
'products'
)
||
this
.
products
.
length
<=
0
)
{
attr
+=
' data-option-empty="true"'
;
}
var
selectedStr
=
''
;
if
(
index
==
0
)
{
selectedStr
=
' selected'
;
}
if
(
type
===
0
)
{
// Text
html
+=
'<div class="'
+
optionClass
+
' text'
+
selectedStr
+
'" '
+
attr
+
'>'
+
(
value
?
value
:
label
)
+
html
+=
'<div class="'
+
optionClass
+
' text'
+
'" '
+
attr
+
'>'
+
(
value
?
value
:
label
)
+
'</div>'
;
}
else
if
(
type
===
1
)
{
// Color
html
+=
'<div class="'
+
optionClass
+
' color'
+
selectedStr
+
'" '
+
attr
+
html
+=
'<div class="'
+
optionClass
+
' color'
+
'" '
+
attr
+
' style="background: '
+
value
+
' no-repeat center; background-size: cover;">'
+
''
+
'</div>'
;
}
else
if
(
type
===
2
)
{
// 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:'
+
swatchImageWidth
+
'px; height:'
+
swatchImageHeight
+
'px">'
+
''
+
'</div>'
;
}
else
if
(
type
===
3
)
{
// Clear
html
+=
'<div class="'
+
optionClass
+
selectedStr
+
'" '
+
attr
+
'></div>'
;
html
+=
'<div class="'
+
optionClass
+
'" '
+
attr
+
'></div>'
;
}
else
{
// 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