TinyMCE's skin injects .mce-fullscreen { z-index: 100 } at editor init,
after core editor.css, so the fullscreen editor (toolbar at the viewport
top) lost to the fixed navbar (.nav-fixed .header, z-index 999). Restore
core's intended 100010 with an element+class selector that outranks the
skin regardless of injection order; it stays below the submit media
dialog (100080). Also remove the dead .mce-top-part.affix rules (no
AKSRT script drives them) and pin both in a contract test.
36 lines
1.4 KiB
JavaScript
36 lines
1.4 KiB
JavaScript
'use strict';
|
|
|
|
const assert = require('node:assert/strict');
|
|
const fs = require('node:fs');
|
|
const path = require('node:path');
|
|
const test = require('node:test');
|
|
|
|
const root = path.resolve(__dirname, '..', '..');
|
|
const read = (file) => fs.readFileSync(path.join(root, file), 'utf8');
|
|
|
|
test('submit.css raises the TinyMCE fullscreen container above the fixed navbar', () => {
|
|
const css = read('assets/css/frontend/pages/submit.css');
|
|
|
|
// TinyMCE's skin injects .mce-fullscreen { z-index: 100 } at editor init,
|
|
// after core editor.css, so the fullscreen editor loses to the fixed navbar
|
|
// (.nav-fixed .header, z-index 999). The element+class selector outranks the
|
|
// skin regardless of injection order and restores core's intended 100010,
|
|
// which stays below the submit media dialog (100080).
|
|
assert.match(css, /div\.mce-fullscreen \{\s*\n z-index: 100010;\s*\n\}/);
|
|
});
|
|
|
|
test('the Zibll toolbar affix rules stay removed', () => {
|
|
const css = read('assets/css/frontend/pages/submit.css');
|
|
const jsRoot = path.join(root, 'assets/js');
|
|
const js = fs
|
|
.readdirSync(jsRoot, { withFileTypes: true })
|
|
.filter((entry) => entry.isFile())
|
|
.map((entry) => read(`assets/js/${entry.name}`))
|
|
.join('\n');
|
|
|
|
// No AKSRT script adds .affix to .mce-top-part (that was Zibll's
|
|
// editextend.js), so the affix positioning rules must not come back.
|
|
assert.doesNotMatch(css, /mce-top-part\.affix/);
|
|
assert.doesNotMatch(js, /mce-top-part/);
|
|
});
|