Skip to content

Commit 2cb9321

Browse files
authored
Merge pull request #70 from pierrekamel5/master
bug fixes
2 parents b369ab0 + 9899a94 commit 2cb9321

File tree

15 files changed

+457
-82
lines changed

15 files changed

+457
-82
lines changed

control/content/assets/css/jquery-ui.css

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,3 +1277,17 @@ body .ui-tooltip {
12771277
max-width: 40% !important;
12781278
margin-right: 0;
12791279
}
1280+
1281+
.cancel-btn {
1282+
color: black;
1283+
border: 1px solid #7676764D;
1284+
border-radius: 4px;
1285+
width:85px;
1286+
height:35px;
1287+
padding-top: 7px;
1288+
}
1289+
.cancel-btn:hover {
1290+
color: black;
1291+
background-color: rgb(239, 239, 239);
1292+
transition: 0.5ms;
1293+
}

control/content/controllers/content.home.controller.js

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,16 @@
192192
editor.loadItems([]);
193193
else
194194
editor.loadItems(ContentHome.data.content.carouselImages);
195+
196+
if (ContentHome.data && ContentHome.data.content && ContentHome.data.content.speed) {
197+
editor.setOptionSpeed(ContentHome.data.content.speed);
198+
}
199+
if (ContentHome.data && ContentHome.data.content && ContentHome.data.content.order) {
200+
editor.setOptionOrder(ContentHome.data.content.order);
201+
}
202+
if (ContentHome.data && ContentHome.data.content && ContentHome.data.content.display) {
203+
editor.setOptionDisplay(ContentHome.data.content.display);
204+
}
195205
}
196206
ContentHome.itemSortableOptions.disabled = !(ContentHome.data.content.sortBy === SORT.MANUALLY);
197207
RankOfLastItem.setRank(ContentHome.data.content.rankOfLastItem || 0);
@@ -288,7 +298,7 @@
288298
};
289299

290300
// create a new instance of the buildfire carousel editor
291-
var editor = new Buildfire.components.carousel.editor("#carousel");
301+
var editor = new Buildfire.components.carousel.editor("#carousel",{},5000,0,0);
292302

293303
// this method will be called when a new item added to the list
294304
editor.onAddItems = function (items) {
@@ -328,6 +338,21 @@
328338
$scope.$digest();
329339
};
330340

341+
editor.onOptionSpeedChange = function (speed) {
342+
ContentHome.data.content.speed = speed;
343+
saveData(JSON.parse(angular.toJson(ContentHome.data)), TAG_NAMES.SEMINAR_INFO);
344+
};
345+
346+
editor.onOptionOrderChange = function (order) {
347+
ContentHome.data.content.order = order;
348+
saveData(JSON.parse(angular.toJson(ContentHome.data)), TAG_NAMES.SEMINAR_INFO);
349+
};
350+
351+
editor.onOptionDisplayChange = function (display) {
352+
ContentHome.data.content.display = display;
353+
saveData(JSON.parse(angular.toJson(ContentHome.data)), TAG_NAMES.SEMINAR_INFO);
354+
};
355+
331356
/**
332357
* getSearchOptions(value) is used to get searchOptions with one more key sort which decide the order of sorting.
333358
*/

control/content/controllers/content.item.controller.js

Lines changed: 47 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,27 +51,32 @@
5151
});
5252
}
5353

54+
var isCarouselImageChanged = false;
55+
5456
$scope.$on('$viewContentLoaded', function () {
5557
$timeout(function () {
5658
// create a new instance of the buildfire carousel editor
57-
editor = new Buildfire.components.carousel.editor("#carousel2");
58-
console.log(editor);
59-
59+
editor = new Buildfire.components.carousel.editor("#carousel2",{},5000,0,0);
6060
// this method will be called when a new item added to the list
6161
editor.onAddItems = function (items) {
6262
if (!ContentItem.item.data.carouselImages)
6363
ContentItem.item.data.carouselImages = [];
6464
ContentItem.item.data.carouselImages.push.apply(ContentItem.item.data.carouselImages, items);
65+
isCarouselImageChanged = true;
6566
$scope.$digest();
6667
};
6768
// this method will be called when an item deleted from the list
6869
editor.onDeleteItem = function (item, index) {
6970
ContentItem.item.data.carouselImages.splice(index, 1);
71+
isCarouselImageChanged = true;
72+
7073
$scope.$digest();
7174
};
7275
// this method will be called when you edit item details
7376
editor.onItemChange = function (item, index) {
7477
ContentItem.item.data.carouselImages.splice(index, 1, item);
78+
isCarouselImageChanged = true;
79+
7580
$scope.$digest();
7681
};
7782
// this method will be called when you change the order of items
@@ -92,6 +97,28 @@
9297
items[newIndex] = tmp;
9398

9499
ContentItem.item.data.carouselImages = items;
100+
isCarouselImageChanged = true;
101+
102+
$scope.$digest();
103+
};
104+
editor.onOptionSpeedChange = function (speed) {
105+
ContentItem.item.data.speed = speed;
106+
isCarouselImageChanged = true;
107+
108+
$scope.$digest();
109+
};
110+
111+
editor.onOptionOrderChange = function (order) {
112+
ContentItem.item.data.order = order;
113+
isCarouselImageChanged = true;
114+
115+
$scope.$digest();
116+
};
117+
118+
editor.onOptionDisplayChange = function (display) {
119+
ContentItem.item.data.display = display;
120+
isCarouselImageChanged = true;
121+
95122
$scope.$digest();
96123
};
97124

@@ -222,10 +249,21 @@
222249
if (ContentItem.item.data.listImage) {
223250
listImage.loadbackground(ContentItem.item.data.listImage);
224251
}
225-
if (!ContentItem.item.data.carouselImages)
226-
editor.loadItems([]);
227-
else
228-
editor.loadItems(ContentItem.item.data.carouselImages);
252+
253+
// editor = new Buildfire.components.carousel.editor("#carousel2");
254+
if (ContentItem.item && ContentItem.item.data && ContentItem.item.data.speed) {
255+
editor.setOptionSpeed(ContentItem.item.data.speed);
256+
}
257+
if (ContentItem.item && ContentItem.item.data && ContentItem.item.data.order) {
258+
editor.setOptionOrder(ContentItem.item.data.order);
259+
}
260+
if (ContentItem.item && ContentItem.item.data && ContentItem.item.data.display) {
261+
editor.setOptionDisplay(ContentItem.item.data.display);
262+
}
263+
if (!ContentItem.item.data.carouselImages)
264+
editor.loadItems([]);
265+
else
266+
editor.loadItems(ContentItem.item.data.carouselImages);
229267
if (ContentItem.item.data.itemListBgImage) {
230268
background.loadbackground(ContentItem.item.data.itemListBgImage);
231269
}
@@ -305,7 +343,8 @@
305343
ContentItem.unchangedData = angular.equals(_data, ContentItem.item.data);
306344

307345
ContentItem.isItemValid = ContentItem.isValidItem(ContentItem.item.data);
308-
if (!ContentItem.isUpdating && !isUnchanged(ContentItem.item) && ContentItem.isItemValid) {
346+
if (!ContentItem.isUpdating && (!isUnchanged(ContentItem.item) || isCarouselImageChanged) && ContentItem.isItemValid) {
347+
isCarouselImageChanged = false
309348
tmrDelayForItem = setTimeout(function () {
310349
if (item.id) {
311350
ContentItem.updateItemData();

control/content/index.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
<script src="../../../../scripts/buildfire/components/carousel/carousel.js"></script>
1616
<script src="../../../../scripts/angular/angular.min.js"></script>
1717
<script src="../../../../scripts/angular/angular-route.min.js"></script>
18-
<script src="../../../../scripts/buildfire/components/actionItems/sortableList.js"></script>
18+
<script src="../../../../scripts/buildfire/components/carouselLight/carouselLightEditor.js"></script>
19+
<script src="../../../../scripts/buildfire/components/pluginInstance/sortableList.js"></script>
1920
<script src="../../../../scripts/angular/ui-bootstrap.min.js"></script>
2021
<script src="../../../../scripts/tinymce/tinymce.min.js"></script>
2122
<script src="../../../../scripts/tinymce/ui-tinymce.js"></script>
@@ -33,6 +34,8 @@
3334
<link rel="stylesheet" href="../../../../styles/transitionAnimation.css">
3435
<script src="../../../../scripts/angular/angular-animate.min.js"></script>
3536
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
37+
38+
<link href="../../../../styles/control/bf-base.css" rel="stylesheet" />
3639

3740
<style>
3841
.material-icons {

control/content/templates/item.html

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,19 @@
8585
</div>
8686
</div>
8787
<hr class="none">
88-
<div id="actionItems" style="margin-bottom:50px;"></div>
89-
<hr class="none">
90-
<div class="item clearfix row" style="width:100%; position:fixed; background-color:white; bottom:0px; z-index:0; margin-left: 0px !important;">
91-
<div class="main pull-right" style="margin-right: 15px; margin-top: 5px;">
92-
<a class="btn btn-primary stretch" style="width:100px;" ng-click="ContentItem.goToHome()"
93-
ng-disabled="!ContentItem.isValidItem(ContentItem.item.data)">Done
88+
<div class="bottom-actions" style="z-index: 1">
89+
<div class="main col-md-9 pull-right" style="margin-right: 1px; margin-top: 5px;">
90+
<div class="col-md-6 pull-right padding-right-zero padding-left-ten">
91+
<a class="btn btn-success pull-right btn-save"
92+
ng-click="ContentItem.goToHome()"
93+
ng-disabled="!ContentItem.isValidItem(ContentItem.item.data)">
94+
Done
95+
</a>
96+
<a class="btn btn-light pull-right cancel-btn"
97+
ng-click="ContentItem.goToHome()">
98+
Cancel
9499
</a>
100+
</div>
95101
</div>
96102
</div>
97103
</tab>

widget/assets/css/style.css

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ html[safe-area="true"] .holder.has-bottom {
620620
}
621621

622622
.holder .bottom.fixed-bottom .hidden-content-show-ios {
623-
height: 500px;
623+
height: 80vh;
624624
}
625625

626626
.holder .bottom.fixed-bottom .hidden-content-show-android {
@@ -1152,4 +1152,28 @@ html[buildfire='widget'] .modal {
11521152
padding: .75rem;
11531153
text-align: left;
11541154
font-size: 15px;
1155+
}
1156+
1157+
#carousel {
1158+
width: 100%;
1159+
min-width:100%;
1160+
max-height: 56vw;
1161+
min-height: 56vw;
1162+
overflow-y: hidden;
1163+
}
1164+
1165+
#carousel img {
1166+
width: 100vw;
1167+
}
1168+
1169+
#carousel1 {
1170+
width: 100%;
1171+
min-width:100%;
1172+
max-height: 56vw;
1173+
min-height: 56vw;
1174+
overflow-y: hidden;
1175+
}
1176+
1177+
#carousel1 img {
1178+
width: 100vw;
11551179
}

0 commit comments

Comments
 (0)