Skip to content

Commit

Permalink
Fixed the undefined and null titles for #32
Browse files Browse the repository at this point in the history
  • Loading branch information
Eworm committed Oct 25, 2019
1 parent f78d29d commit 7e0839f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion BigKahuna/resources/assets/js/components/BkPageTree.vue
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,11 @@ export default {
},
onDrag: function($item, container, _super, event) {
// Update the placeholder template to show the page name.
$('.branch-placeholder').find('.page-text').text(`${draggedPage.title} (${draggedPage.type})`);
if (Array.isArray(draggedPage.locales)) {
$('.branch-placeholder').find('.page-text').text(`${draggedPage.locales[0].title} (${draggedPage.type})`);
} else {
$('.branch-placeholder').find('.page-text').text(`${draggedPage.title} (${draggedPage.type})`);
}
_super($item, container);
},
onDrop: function($item, container, _super, event) {
Expand Down
Loading

0 comments on commit 7e0839f

Please sign in to comment.