Commit 4d3bd3a5 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge "Bug 1731330: edit/delete buttons to button group SE"

parents 4cdcda8d 8f36bac9
...@@ -57,11 +57,11 @@ if ($frameworks) { ...@@ -57,11 +57,11 @@ if ($frameworks) {
'name' => 'framework_delete_' . $framework->id, 'name' => 'framework_delete_' . $framework->id,
'successcallback' => 'framework_delete_submit', 'successcallback' => 'framework_delete_submit',
'renderer' => 'div', 'renderer' => 'div',
'class' => 'form-inline pull-right framework', 'class' => 'btn-group-last',
'elements' => array( 'elements' => array(
'submit' => array( 'submit' => array(
'type' => 'button', 'type' => 'button',
'class' => 'btn-default btn-sm', 'class' => 'btn-default btn-xs button',
'usebuttontag' => true, 'usebuttontag' => true,
'value' => '<span class="icon icon-trash icon-lg text-danger" role="presentation" aria-hidden="true"></span><span class="sr-only">'. get_string('delete') . '</span>', 'value' => '<span class="icon icon-trash icon-lg text-danger" role="presentation" aria-hidden="true"></span><span class="sr-only">'. get_string('delete') . '</span>',
'confirm' => get_string('confirmdeletemenuitem', 'admin'), 'confirm' => get_string('confirmdeletemenuitem', 'admin'),
...@@ -79,14 +79,13 @@ if ($frameworks) { ...@@ -79,14 +79,13 @@ if ($frameworks) {
'name' => 'framework_config_' . $framework->id, 'name' => 'framework_config_' . $framework->id,
'successcallback' => 'framework_config_submit', 'successcallback' => 'framework_config_submit',
'renderer' => 'div', 'renderer' => 'div',
'class' => 'form-inline pull-right framework', 'class' => (empty($framework->collections) ? 'btn-group-first' : 'btn-group-first btn-group-last'),
'elements' => array( 'elements' => array(
'submit' => array( 'submit' => array(
'type' => 'button', 'type' => 'button',
'class' => 'btn-default btn-sm', 'class' => 'btn-default btn-xs button',
'usebuttontag' => true, 'usebuttontag' => true,
'value' => '<span class="icon icon-cog icon-lg" role="presentation" aria-hidden="true"></span><span class="sr-only">'. get_string('delete') . '</span>', 'value' => '<span class="icon icon-cog icon-lg" role="presentation" aria-hidden="true"></span><span class="sr-only">'. get_string('edit') . '</span>',
), ),
'framework' => array( 'framework' => array(
'type' => 'hidden', 'type' => 'hidden',
......
...@@ -30,17 +30,23 @@ ...@@ -30,17 +30,23 @@
<span title="{$item->active.title}" class="{$item->active.classes}"></span> <span title="{$item->active.title}" class="{$item->active.classes}"></span>
</td> </td>
<td class="buttonscell framework"> <td class="buttonscell framework">
<script type="application/javascript"> <script type="application/javascript">
jQuery('#framework{$item->id}_enabled').on('change', function() { jQuery('#framework{$item->id}_enabled').on('change', function() {
// save switch // save switch
jQuery.post(config.wwwroot + 'module/framework/frameworks.json.php', jQuery('#framework{$item->id}').serialize()) jQuery.post(config.wwwroot + 'module/framework/frameworks.json.php', jQuery('#framework{$item->id}').serialize())
.done(function(data) { .done(function(data) {
console.log(data); console.log(data);
});
}); });
}); </script>
</script> <div class="pull-right btn-group form-as-button">
{$item->config|safe} {$item->config|safe}
{$item->delete|safe} {if $item->delete}
{$item->delete|safe}
{else}
<span class="no-delete-btn"></span>
{/if}
</div>
</td> </td>
</tr> </tr>
{/foreach} {/foreach}
......
...@@ -77,15 +77,35 @@ ...@@ -77,15 +77,35 @@
// If there are not-button siblings of group button elements // If there are not-button siblings of group button elements
.btn-group > .no-delete-btn { .btn-group > .no-delete-btn {
margin-right: 27px; margin-right: 28px;
} }
.btn-group > .btn.btn-group-first { .btn-group > .btn.btn-group-first {
border-top-left-radius: 3px !important; border-top-left-radius: 3px !important;
border-bottom-left-radius: 3px !important; border-bottom-left-radius: 3px !important;
} }
.btn-group > .btn-group-first:not(.btn-group-last) {
display: inline-block;
.btn {
border-top-right-radius: 0 !important;
border-bottom-right-radius: 0 !important;
}
}
.btn-group > .btn.btn-group-last { .btn-group > .btn.btn-group-last {
border-top-right-radius: 3px !important; border-top-right-radius: 3px !important;
border-bottom-right-radius: 3px !important; border-bottom-right-radius: 3px !important;
} }
.btn-group > .btn-group-last:not(.btn-group-first) {
display: inline-block;
margin-left: -4px;
.btn {
border-top-left-radius: 0 !important;
border-bottom-left-radius: 0 !important;
}
}
.btn-group > .btn-group-first.btn-group-last {
display: inline-block;
margin-left: -4px;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment