Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
vue-shufflejs-plugin
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dmstr
vue-shufflejs-plugin
Commits
e24bcb43
Commit
e24bcb43
authored
May 11, 2020
by
Marc Mautz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated image url handling, added mixin "getImageUrl"
parent
09835b96
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
12 deletions
+21
-12
Detail.vue
src/components/Detail.vue
+1
-1
VueShuffleGrid.vue
src/components/VueShuffleGrid.vue
+2
-11
index.js
src/index.js
+18
-0
No files found.
src/components/Detail.vue
View file @
e24bcb43
...
...
@@ -13,7 +13,7 @@
</h2>
</div>
<div
class=
"col-xs-12 col-md-8"
>
<img
:src=
"
'http://manufacturer-blueprint.workbench.oneba.se/filefly/api?action=stream&path=' + productData.image_url
"
<img
:src=
"
getImageUrl(productData)
"
class=
"img-responsive product-image"
:title=
"productData.heading"
:alt=
"productData.heading"
>
...
...
src/components/VueShuffleGrid.vue
View file @
e24bcb43
...
...
@@ -15,8 +15,8 @@
<span
class=
"subheading"
>
{{
item
.
subheading
}}
</span>
</p>
</figcaption>
<div
class=
"figure-img-wrap"
:style=
"
{backgroundImage: 'url(' + getImageUrl(item
.image_url
) + ')'}">
<loading-indicator
v-if=
"item.image_url"
></loading-indicator>
<div
class=
"figure-img-wrap"
:style=
"
{backgroundImage: 'url(' + getImageUrl(item) + ')'}">
<loading-indicator
v-if=
"item.image_url
|| item.absolute_image_url
"
></loading-indicator>
</div>
</figure>
</a>
...
...
@@ -124,15 +124,6 @@
}
else
{
return
this
.
settings
.
baseUrl
+
this
.
settings
.
detailPath
+
id
}
},
/**
* Get absolute image url
* @param imageUrl
* @returns {string}
*/
getImageUrl
(
imageUrl
)
{
// return this.settings.baseUrl + this.settings.imageApiPath + imageUrl
return
this
.
settings
.
imgBaseUrl
+
'/'
+
this
.
settings
.
imgHostPrefix
+
imageUrl
+
this
.
settings
.
imgHostSuffix
}
}
}
...
...
src/index.js
View file @
e24bcb43
...
...
@@ -64,6 +64,24 @@ const VueShuffleJsPlugin = {
}
else
{
// console.info('$i18n is not installed...')
}
},
methods
:
{
/**
* Get absolute image url
* @desc if "useAbsoluteImageUrls" is set return "absolute_image_url", otherwise return concatenated "image_url"
* @param item
* @returns {string}
*/
getImageUrl
(
item
)
{
if
(
this
.
settings
.
useAbsoluteImageUrls
)
{
if
(
!
item
.
absolute_image_url
)
{
throw
Error
(
'Missing "absolute_image_url" property!'
)
}
return
item
.
absolute_image_url
}
return
this
.
settings
.
imgBaseUrl
+
'/'
+
this
.
settings
.
imgHostPrefix
+
item
.
image_url
+
this
.
settings
.
imgHostSuffix
}
}
})
}
...
...
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