Commit 8f36bac9 authored by Cecilia Vela Gurovic's avatar Cecilia Vela Gurovic Committed by Robert Lyon

Bug 1731330: edit/delete buttons to button group SE

Edit/delete buttons to be button group in SmarEvidence
matrix list
/module/framework/frameworks.php

behatnotneeded

Change-Id: Ib0b046d2ea6df155ea22876071660288129da9e1
parent ca13ec5b
......@@ -57,11 +57,11 @@ if ($frameworks) {
'name' => 'framework_delete_' . $framework->id,
'successcallback' => 'framework_delete_submit',
'renderer' => 'div',
'class' => 'form-inline pull-right framework',
'class' => 'btn-group-last',
'elements' => array(
'submit' => array(
'type' => 'button',
'class' => 'btn-default btn-sm',
'class' => 'btn-default btn-xs button',
'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>',
'confirm' => get_string('confirmdeletemenuitem', 'admin'),
......@@ -79,14 +79,13 @@ if ($frameworks) {
'name' => 'framework_config_' . $framework->id,
'successcallback' => 'framework_config_submit',
'renderer' => 'div',
'class' => 'form-inline pull-right framework',
'class' => (empty($framework->collections) ? 'btn-group-first' : 'btn-group-first btn-group-last'),
'elements' => array(
'submit' => array(
'type' => 'button',
'class' => 'btn-default btn-sm',
'class' => 'btn-default btn-xs button',
'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(
'type' => 'hidden',
......
......@@ -30,17 +30,23 @@
<span title="{$item->active.title}" class="{$item->active.classes}"></span>
</td>
<td class="buttonscell framework">
<script type="application/javascript">
jQuery('#framework{$item->id}_enabled').on('change', function() {
// save switch
jQuery.post(config.wwwroot + 'module/framework/frameworks.json.php', jQuery('#framework{$item->id}').serialize())
.done(function(data) {
console.log(data);
<script type="application/javascript">
jQuery('#framework{$item->id}_enabled').on('change', function() {
// save switch
jQuery.post(config.wwwroot + 'module/framework/frameworks.json.php', jQuery('#framework{$item->id}').serialize())
.done(function(data) {
console.log(data);
});
});
});
</script>
{$item->config|safe}
{$item->delete|safe}
</script>
<div class="pull-right btn-group form-as-button">
{$item->config|safe}
{if $item->delete}
{$item->delete|safe}
{else}
<span class="no-delete-btn"></span>
{/if}
</div>
</td>
</tr>
{/foreach}
......
......@@ -77,15 +77,35 @@
// If there are not-button siblings of group button elements
.btn-group > .no-delete-btn {
margin-right: 27px;
margin-right: 28px;
}
.btn-group > .btn.btn-group-first {
border-top-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 {
border-top-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