fix width of re-order column

This commit is contained in:
Stephen Birarda 2015-05-20 11:31:32 -07:00
parent 8fb5c53142
commit 227bdff07a
2 changed files with 19 additions and 7 deletions

View file

@ -65,6 +65,10 @@ td.buttons {
width: 30px;
}
td.buttons.reorder-buttons {
width: 40px;
}
td .glyphicon {
text-align: center;
font-size: 12px;

View file

@ -168,12 +168,20 @@ $(document).ready(function(){
if (sibling.hasClass(Settings.DATA_COL_CLASS)) {
// set focus to next input
sibling.find('input').focus()
} else if (sibling.hasClass(Settings.ADD_DEL_BUTTONS_CLASS)) {
sibling.find('.' + Settings.ADD_ROW_BUTTON_CLASS).click()
sibling.find('input').focus();
} else {
// set focus to the first input in the new row
$target.closest('table').find('tr.inputs input:first').focus()
// jump over the re-order row, if that's what we're on
if (sibling.hasClass(Settings.REORDER_BUTTONS_CLASS)) {
sibling = sibling.next();
}
if (sibling.hasClass(Settings.ADD_DEL_BUTTONS_CLASS)) {
sibling.find('.' + Settings.ADD_ROW_BUTTON_CLASS).click()
// set focus to the first input in the new row
$target.closest('table').find('tr.inputs input:first').focus()
}
}
} else if ($target.is('input')) {
@ -801,8 +809,8 @@ function makeTable(setting, keypath, setting_value, isLocked) {
if (!isLocked && !setting.read_only) {
if (setting.can_order) {
html += "<td class=" + Settings.REORDER_BUTTONS_CLASSES +
"><a href='javascript:void(0);' class='glyphicon glyphicon-sort'></a></td>";
html += "<td class='" + Settings.REORDER_BUTTONS_CLASSES +
"'><a href='javascript:void(0);' class='glyphicon glyphicon-sort'></a></td>";
}
html += "<td class='" + Settings.ADD_DEL_BUTTONS_CLASSES + "'></td></tr>"
}