Skip to content
Code-Schnipsel Gruppen Projekte
Commit b3b1f5d1 erstellt von Jan Wennrich's avatar Jan Wennrich
Dateien durchsuchen

feat: show message if NivoSlider has no images assigned (#2)

Übergeordneter 52da3800
No related branches found
No related tags found
1 Merge Request!1Dev
......@@ -23,10 +23,10 @@
define('package/quiqqer/slider/bin/NivoSlider', [
'qui/utils/Functions',
'Locale',
'css!package/quiqqer/slider/bin/NivoSlider.css'
], function (QUIFunctionsUtils) {
], function (QUIFunctionsUtils, QUILocale) {
"use strict";
return new Class({
......@@ -405,6 +405,21 @@ define('package/quiqqer/slider/bin/NivoSlider', [
this.children = this.getImages();
if (this.children.length < 1) {
var icon = '<span class="fa fa-2x fa-file-image-o"></span>',
text = '<p>'+QUILocale.get('quiqqer/gallery', "quiqqer.gallery.slider.noImages")+'</p>',
html = icon + text;
new Element('div', {
html: html,
styles: {
'text-align': 'center'
}
}).inject(this.container);
return;
}
this.holderImage = new Element('img', {
src : this.children[0].get('src'),
'class': 'nivoo-slider-holder-image',
......@@ -840,6 +855,10 @@ define('package/quiqqer/slider/bin/NivoSlider', [
},
setBackgroundImage: function () {
if (!this.currentImage) {
return false;
}
this.holderImage.set('src', this.currentImage.get('src'));
var holderSize = this.holder.getSize(),
......
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren