Unverified Commit bf51490e authored by alexpott's avatar alexpott
Browse files

Issue #3089752 by bnjmnm, zrpnr: Follow-up to #3074267 Refactor use of...

Issue #3089752 by bnjmnm, zrpnr: Follow-up to #3074267 Refactor use of classList in quickedit for browser compatibility
parent b12a3a59
...@@ -299,9 +299,9 @@ ...@@ -299,9 +299,9 @@
function refinePopper(data) { function refinePopper(data) {
// Determine if the pointer should be on the top or bottom. // Determine if the pointer should be on the top or bottom.
const isBelow = data.offsets.popper.top > data.offsets.reference.top; const isBelow = data.offsets.popper.top > data.offsets.reference.top;
data.instance.popper.classList.toggle( const classListMethod = isBelow ? 'add' : 'remove';
data.instance.popper.classList[classListMethod](
'quickedit-toolbar-pointer-top', 'quickedit-toolbar-pointer-top',
isBelow,
); );
// Don't position the toolbar past the first or last editable field if // Don't position the toolbar past the first or last editable field if
// the entity is the target. // the entity is the target.
......
...@@ -165,7 +165,8 @@ ...@@ -165,7 +165,8 @@
function refinePopper(data) { function refinePopper(data) {
var isBelow = data.offsets.popper.top > data.offsets.reference.top; var isBelow = data.offsets.popper.top > data.offsets.reference.top;
data.instance.popper.classList.toggle('quickedit-toolbar-pointer-top', isBelow); var classListMethod = isBelow ? 'add' : 'remove';
data.instance.popper.classList[classListMethod]('quickedit-toolbar-pointer-top');
if (that.$entity[0] === data.instance.reference) { if (that.$entity[0] === data.instance.reference) {
var $field = that.$entity.find('.quickedit-editable').eq(isBelow ? -1 : 0); var $field = that.$entity.find('.quickedit-editable').eq(isBelow ? -1 : 0);
......
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