Files
edittable/script/editbutton.js
Michael Große 23291d09c4 style: eslint fixes
This is mostly indentation and double->single quotes. It includes
turning qunit env on for qunit test-files and disabling no-magic-numbers
for a test-file that is all about moving a row from position one to
position two and back again.
2017-09-04 20:21:47 +02:00

26 lines
711 B
JavaScript

/**
* Adjust the top margin and make buttons visible
*/
jQuery(function () {
'use strict';
var $editbutton = jQuery('.dokuwiki div.editbutton_table');
if (!$editbutton.length) {
return;
}
// unhide the buttons - we have JavaScript
$editbutton.show();
// determine the bottom margin of the table above and remove it from our button
var margin = 0;
var $tablediv = $editbutton.prev('div.table');
if (!$tablediv.length) {
return;
}
margin += parseFloat($tablediv.css('margin-bottom'));
margin += parseFloat($tablediv.find('table').css('margin-bottom'));
margin += 1; // for the border
$editbutton.css('margin-top', margin * -1);
});