Skip to content

Commit

Permalink
adjusting layout-class-directive to set correct layout in embeds no m…
Browse files Browse the repository at this point in the history
…atter current url #2454 (#986)
  • Loading branch information
Angamanga authored Feb 12, 2018
1 parent d379643 commit 3d000b7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
5 changes: 0 additions & 5 deletions app/common/directives/layout-class.directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,8 @@ function LayoutClassDirective() {
LayoutClassController.$inject = ['$scope', '$rootScope', '$window', 'Util'];
function LayoutClassController($scope, $rootScope, $window, Util) {
var isEmbed = ($window.self !== $window.top) ? true : false;
// In the case of map we omit the layout-a class
var isMap = (Util.currentUrl()) ? Util.currentUrl().indexOf('map') > 0 : false;

if (!isEmbed) {
$rootScope.setLayout('layout-' + $scope.layout);
} else if (isEmbed && isMap) {
$rootScope.setLayout('layout-embed');
} else {
// If we are in embed mode
// we must append the layout to the embed layout
Expand Down
8 changes: 4 additions & 4 deletions app/main/posts/detail/post-detail-data.directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ function PostDetailDataController(
$scope.$watch('post', function (post) {
activate();
});
/* need to check for embed here to set the correct class
* if coming from map to detail-view in embed, TODO: should go to a service! */
var isEmbed = ($window.self !== $window.top) ? true : false;
isEmbed ? $rootScope.setLayout('layout-d layout-embed') : $rootScope.setLayout('layout-d');
// /* need to check for embed here to set the correct class
// * if coming from map to detail-view in embed, TODO: should go to a service! */
// var isEmbed = ($window.self !== $window.top) ? true : false;
// isEmbed ? $rootScope.setLayout('layout-d layout-embed') : $rootScope.setLayout('layout-d');

$scope.post = $scope.post;
$scope.post_task = {};
Expand Down
1 change: 1 addition & 0 deletions app/main/posts/detail/post-detail-data.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<div>
<layout-class layout="d"></layout-class>
<article class="postcard" role="article">
<button class="button-beta button-flat postcard-close" ng-click="close()">
<svg class="iconic">
Expand Down

0 comments on commit 3d000b7

Please sign in to comment.