-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
87e38db
commit 9668fab
Showing
2 changed files
with
34 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
(function ($) { | ||
|
||
Backdrop.behaviors.ogUiContentTypes = { | ||
// Provide the vertical tab summaries for OG. | ||
attach: function (context) {console.log('loaded'); | ||
var $context = $(context); | ||
$context.find('fieldset#edit-og').backdropSetSummary(function() {console.log('found it') | ||
var vals = []; | ||
if ($context.find('input[name="og_group_type"]:checked').length) { | ||
vals.push(Backdrop.t('Is a "Group" content type')); | ||
} | ||
|
||
if ($context.find('input[name="og_group_content_type"]:checked').length) { | ||
vals.push(Backdrop.t('Is a "Group content" content type')); | ||
var target_type = $context.find('select[name="target_type"]').find('option:selected').text(); | ||
console.log(target_type); | ||
if (target_type) { | ||
vals.push(Backdrop.t('Target type: ' + target_type)); | ||
} | ||
var target_bundles = $context.find('select[name="target_bundles[]"]').find('option:selected').toArray().map(item => item.text).join(); | ||
if (target_bundles) { | ||
vals.push(Backdrop.t('Target bundles: ' + target_bundles)); | ||
} | ||
} | ||
|
||
return vals.length ? vals.join(', ') : Backdrop.t('Not set'); | ||
}); | ||
} | ||
}; | ||
|
||
})(jQuery); |
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