Skip to content

Commit

Permalink
change: サムネイル画像に記事のリンクを付与するように修正
Browse files Browse the repository at this point in the history
  • Loading branch information
s-nakajima committed Jan 15, 2021
1 parent d2995b7 commit 5bb1dac
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion View/Elements/Topics/item.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@
</div>
<?php if ($topicFrameSetting['display_thumbnail'] && !empty($item['Topic']['thumbnail_url'])) : ?>
<div class="media-right">
<img src="<?php echo h($item['Topic']['thumbnail_url']); ?>" alt="">
<a href="<?php echo $item['Topic']['url']; ?>" ng-click="link($event)">
<img src="<?php echo h($item['Topic']['thumbnail_url']); ?>" alt="" />
</a>
</div>
<?php endif; ?>
</div>
Expand Down
4 changes: 3 additions & 1 deletion View/Elements/Topics/item_angularjs.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@
</div>
<?php if ($topicFrameSetting['display_thumbnail']) : ?>
<div class="media-right" ng-show="item.Topic.thumbnail_path">
<img ng-src="{{item.Topic.thumbnail_url}}" alt="">
<a ng-href="{{item.Topic.url}}" ng-click="link($event)">
<img ng-src="{{item.Topic.thumbnail_url}}" alt="">
</a>
</div>
<?php endif; ?>
</div>
Expand Down
2 changes: 1 addition & 1 deletion webroot/js/topics.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ NetCommonsApp.controller('TopicsController',
$location.hash(
'page:' + ($scope.paging['page']) + '&' + 'frame_id:' + $scope.params['frame_id']
);
$window.location.href = $event.target.href;
$window.location.href = $event.currentTarget.href;
$event.preventDefault();
};

Expand Down

0 comments on commit 5bb1dac

Please sign in to comment.