-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from sakshityagi/master
Showed init data for carousel and wysiwyg text in both content and widget section
- Loading branch information
Showing
2 changed files
with
58 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,12 +77,38 @@ | |
return; | ||
} | ||
|
||
if (result && result.data && !angular.equals({}, result.data)) { | ||
if (result && result.data && !angular.equals({}, result.data) && result.id) { | ||
$scope.data = result.data; | ||
$scope.id = result.id; | ||
if($scope.data.content && $scope.data.content.carouselImages) | ||
editor.loadItems($scope.data.content.carouselImages); | ||
if (tmrDelay) clearTimeout(tmrDelay); | ||
} else{ | ||
$scope.data = { content :{ | ||
text : | ||
'<p>The WYSIWYG (which stands for What You See Is What You Get) allows you to do some really cool stuff. You can add images like this</p>\ | ||
<p><img src="https://static.pexels.com/photos/12057/pexels-photo-12057-large.jpeg" alt="" width="100%" height="auto" /></p>\ | ||
<p>You can even create links like these:<br /> Link to web content like <a href="http://www.google.com">this</a><br /> Link to a phone number like this <a href="tel: 8005551234">8005551234</a><br /> Link to an email like this <a href="mailto:[email protected]">[email protected]</a></p>\ | ||
<p>Want to add some super cool videos about this item? You can do that too!</p>\ | ||
<p><iframe src="https://www.youtube.com/embed/wTcNtgA6gHs" width="100%" height="auto" frameborder="0" allowfullscreen="allowfullscreen"></iframe></p>\ | ||
<p>You can create bulleted and numbered lists like this:</p>\ | ||
<ul>\ | ||
<li>This is an item in a list</li>\ | ||
<li>This is another item in a list</li>\ | ||
<li>This is a last item in a list</li>\ | ||
</ul>\ | ||
<p>Want more info? Check out our tutorial by clicking the help button at the top of this page.</p>', | ||
|
||
carouselImages : | ||
[{"action":"noAction","iconUrl":"http://imageserver.prod.s3.amazonaws.com/b55ee984-a8e8-11e5-88d3-124798dea82d/5db61d30-0854-11e6-8963-f5d737bc276b.jpg","title":"image 1"},{"action":"noAction","iconUrl":"http://imageserver.prod.s3.amazonaws.com/b55ee984-a8e8-11e5-88d3-124798dea82d/31c88a00-0854-11e6-8963-f5d737bc276b.jpeg","title":"image 2"}] | ||
}, | ||
design: { | ||
backgroundImage: null, | ||
backgroundBlur: 0, | ||
selectedLayout: 1 | ||
} | ||
}; | ||
editor.loadItems($scope.data.content.carouselImages); | ||
} | ||
|
||
/* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,6 +50,8 @@ | |
function initDeviceSize(callback) { | ||
$scope.deviceHeight = window.innerHeight; | ||
$scope.deviceWidth = window.innerWidth; | ||
|
||
console.log(">>>>>>>>>>>>>>>>>>>", $scope.data); | ||
if ($scope.data.design.selectedLayout == 1) { | ||
$scope.sliderHeight = Math.ceil(9 * $scope.deviceWidth / 16); | ||
} else { | ||
|
@@ -99,7 +101,35 @@ | |
* */ | ||
function loadData() { | ||
buildfire.datastore.get(function (err, result) { | ||
if (result && result.data && !angular.equals({}, result.data)) bind(result.data); | ||
if (result && result.data && !angular.equals({}, result.data) && result.id){ | ||
bind(result.data); | ||
} else{ | ||
$scope.data = { content :{ | ||
text : | ||
'<p>The WYSIWYG (which stands for What You See Is What You Get) allows you to do some really cool stuff. You can add images like this</p>\ | ||
<p><img src="https://static.pexels.com/photos/12057/pexels-photo-12057-large.jpeg" alt="" width="100%" height="auto" /></p>\ | ||
<p>You can even create links like these:<br /> Link to web content like <a href="http://www.google.com">this</a><br /> Link to a phone number like this <a href="tel: 8005551234">8005551234</a><br /> Link to an email like this <a href="mailto:[email protected]">[email protected]</a></p>\ | ||
<p>Want to add some super cool videos about this item? You can do that too!</p>\ | ||
<p><iframe src="https://www.youtube.com/embed/wTcNtgA6gHs" width="100%" height="auto" frameborder="0" allowfullscreen="allowfullscreen"></iframe></p>\ | ||
<p>You can create bulleted and numbered lists like this:</p>\ | ||
<ul>\ | ||
<li>This is an item in a list</li>\ | ||
<li>This is another item in a list</li>\ | ||
<li>This is a last item in a list</li>\ | ||
</ul>\ | ||
<p>Want more info? Check out our tutorial by clicking the help button at the top of this page.</p>', | ||
|
||
carouselImages : | ||
[{"action":"noAction","iconUrl":"http://imageserver.prod.s3.amazonaws.com/b55ee984-a8e8-11e5-88d3-124798dea82d/5db61d30-0854-11e6-8963-f5d737bc276b.jpg","title":"image 1"},{"action":"noAction","iconUrl":"http://imageserver.prod.s3.amazonaws.com/b55ee984-a8e8-11e5-88d3-124798dea82d/31c88a00-0854-11e6-8963-f5d737bc276b.jpeg","title":"image 2"}] | ||
}, | ||
design: { | ||
backgroundImage: null, | ||
backgroundBlur: 0, | ||
selectedLayout: 1 | ||
} | ||
}; | ||
bind($scope.data); | ||
} | ||
}); | ||
} | ||
|
||
|