Skip to content

Commit

Permalink
fix: correctly show sort buttons in non-bootstrap mode. Use helpers.t…
Browse files Browse the repository at this point in the history
…oggleHighlight when sorting elements rather than a custom animation
  • Loading branch information
lucasnetau committed Oct 4, 2023
1 parent eb4fd68 commit a1f6638
Showing 1 changed file with 9 additions and 24 deletions.
33 changes: 9 additions & 24 deletions src/js/form-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -1073,18 +1073,20 @@ function FormBuilder(opts, element, $) {
}),
)
} else {
m('a', null, {
type: 'sort',
id: data.lastID + '-sort-higher',
className: `sort-button sort-button-higher btn ${css_prefix_text}sort-higher`,
title: 'Move Higher',
}),
fieldButtons.push(
m('a', null, {
type: 'sort',
id: data.lastID + '-sort-higher',
className: `sort-button sort-button-higher btn ${css_prefix_text}sort-higher`,
title: 'Move Higher',
}),
m('a', null, {
type: 'sort',
id: data.lastID + '-sort-lower',
className: `sort-button sort-button-lower btn ${css_prefix_text}sort-lower`,
title: 'Move Lower',
})
)
}

if (disabledFieldButtons && Array.isArray(disabledFieldButtons)) {
Expand Down Expand Up @@ -2331,24 +2333,7 @@ function FormBuilder(opts, element, $) {
}
}

if (swap.length) {
//Animate the flashing of the background and border of the element was moved
currentItem.css({
'border-color': '#66afe9',
'outline': 0,
'box-shadow': 'inset 0 1px 1px rgba(0,0,0,.1),0 0 8px rgba(102,175,233,.6)',
'background-color': '#b7d6f5',
}).delay('fast')
.queue(function(next) {
$(this).css({
'border-color': '',
'outline': '',
'box-shadow': '',
'background-color': ''
})
next()
})
}
h.toggleHighlight(currentItem)
})

// Update button style selection
Expand Down

0 comments on commit a1f6638

Please sign in to comment.