Skip to content

Commit

Permalink
Merge pull request #106 from dahabi/master
Browse files Browse the repository at this point in the history
add lightCarousel
  • Loading branch information
abuturla authored Jan 24, 2018
2 parents 4279782 + 5aab64d commit 0502f99
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 28 deletions.
4 changes: 2 additions & 2 deletions control/content/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
<script src="../../../../scripts/angular/angular-ui-sortable.js"></script>
<script src="../../../../scripts/angular/angular.min.js"></script>
<script src="../../../../scripts/angular/angular-route.min.js"></script>
<script src="../../../../scripts/buildfire.js"></script>
<script src="../../../../scripts/buildfire.min.js"></script>
<script src="../../../../scripts/jquery/jquery-ui.min.js"></script>
<script src="../../../../scripts/angular/angular-ui-sortable.js"></script>
<script src="../../../../scripts/buildfire/components/carousel/carousel.js"></script>
<script src="../../../../scripts/buildfire/components/carouselLight/carouselLightEditor.js"></script>
<script src="../../../../scripts/tinymce/tinymce.min.js"></script>
<script src="../../../../scripts/tinymce/ui-tinymce.js"></script>
<script src="../../../../scripts/angular/ui-bootstrap.min.js"></script>
Expand Down
29 changes: 14 additions & 15 deletions widget/controllers/widget.home.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,21 @@
WidgetHome.view = null;

//Refresh data on pulling the tile bar

function initCarousel(carouselImages){
var carouselContainer = document.getElementById("carousel");
var carousel = new buildfire.components.carousel.view({
selector: carouselContainer,
items: carouselImages,
speed: 1000
});
}
buildfire.datastore.onRefresh(function () {
init(function (err) {
if (!err) {
if (!WidgetHome.view) {
WidgetHome.view = new Buildfire.components.carousel.view("#carousel", []);
}

if (WidgetHome.data.content && WidgetHome.data.content.carouselImages) {
WidgetHome.view.loadItems(WidgetHome.data.content.carouselImages);
} else {
WidgetHome.view.loadItems([]);
initCarousel(WidgetHome.data.content.carouselImages);

}
}
});
Expand Down Expand Up @@ -143,13 +147,8 @@
init(function(){});
$scope.$on('$viewContentLoaded', function () {
$rootScope.$on("Carousel:LOADED", function () {
if (!WidgetHome.view) {
WidgetHome.view = new Buildfire.components.carousel.view("#carousel", []);
}
if (WidgetHome.data.content && WidgetHome.data.content.carouselImages) {
WidgetHome.view.loadItems(WidgetHome.data.content.carouselImages);
} else {
WidgetHome.view.loadItems([]);
initCarousel(WidgetHome.data.content.carouselImages);
}
});
});
Expand Down Expand Up @@ -178,8 +177,8 @@
WidgetHome.view = null;
}
else {
if (WidgetHome.view) {
WidgetHome.view.loadItems(WidgetHome.data.content.carouselImages);
{
initCarousel(WidgetHome.data.content.carouselImages);
}
}
currentListLayout = WidgetHome.data.design.listLayout;
Expand Down
10 changes: 7 additions & 3 deletions widget/css/widget.app.css
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,14 @@
height: 100%;
}

.owl-carousel .owl-controls .owl-dots {
text-align: center;
}

#carousel {
width: 100%;
min-width:100%;
max-height: 56vw;
min-height: 56vw;
overflow-y: hidden;
}
.mapSize{
height: 192px;
}
Expand Down
11 changes: 4 additions & 7 deletions widget/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,18 @@
<html ng-app="contactUsPluginWidget">
<head>
<!--<base href="./"/>-->

<meta name="buildfire" content="disableBootstrap"/>
<!-- CSS -->
<link rel="stylesheet" href="../../../styles/siteIcons.css">
<link rel="stylesheet" href="../../../styles/helper.css">
<link rel="stylesheet" href="../../../scripts/owlCarousel/owlCarousel.css">
<link rel="stylesheet" href="css/widget.app.css">

<!--Angular, jQuery & Owl Carousel -->
<script src="../../../scripts/jquery/jquery-1.11.2.min.js"></script>
<script src="../../../scripts/smartcrop.js"></script>
<script src="../../../scripts/buildfire.js"></script>
<script type="text/javascript"
src="../../../scripts/owlCarousel/owlCarousel.js"></script>
<script
src="../../../scripts/buildfire/components/carousel/carousel.js"></script>
<script src="../../../scripts/buildfire.min.js"></script>

<script src="../../../scripts/_bundles/buildfire_lightcarousel.min.js"></script>
<script src="../../../scripts/angular/angular.min.js"></script>
<script src="../../../scripts/angular/angular-route.min.js"></script>
<script src="js/angular-touch.min.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion widget/templates/Layout_1.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="holder padding-zero">
<div class="contact-plugin layout1">
<div class="plugin-banner clearfix">
<div id="carousel"
<div id="carousel" class="sliderCarousel"
ng-style="WidgetHome.data.content.carouselImages.length > 0 ? {'min-height': (9 * deviceWidth / 16) + 'px' } : {}"
build-fire-carousel=""></div>
</div>
Expand Down

0 comments on commit 0502f99

Please sign in to comment.