Skip to content

Commit

Permalink
#4 Completed collapsed block content preview
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamminf committed Sep 20, 2016
1 parent ac8298a commit bff9012
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions src/input/Block.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ export default Garnish.Base.extend({
case 'Assets':
{
const values = []
const $assets = $input.find('.elementselect > .elements > .element')
const $assets = $input.find('.element')

$assets.each(function()
{
Expand All @@ -314,9 +314,21 @@ export default Garnish.Base.extend({
break
case 'Categories':
case 'Entries':
case 'Tags':
case 'Users':
{
const values = []
const $elements = $input.find('.element')

$elements.each(function()
{
const $element = $(this)
const title = $element.find('.title').text()

values.push(_escapeHTML(title))
})

value = values.join(', ')
}
break
case 'Checkboxes':
Expand Down Expand Up @@ -367,11 +379,6 @@ export default Garnish.Base.extend({
const enabled = !!$input.find('input').val()

value = `<span class="status${enabled ? ' live' : ''}"></span>` + _escapeHTML(label)
}
break
case 'Matrix':
{

}
break
case 'MultiSelect':
Expand Down Expand Up @@ -412,16 +419,6 @@ export default Garnish.Base.extend({
value = _stripHTML($input.find('textarea').val())
}
break
case 'Table':
{

}
break
case 'Tags':
{

}
break
}

if(value)
Expand Down

0 comments on commit bff9012

Please sign in to comment.