diff --git a/edit/edit.css b/edit/edit.css index 463e938a..55218b60 100644 --- a/edit/edit.css +++ b/edit/edit.css @@ -453,7 +453,7 @@ input:invalid { display: none; } .section .CodeMirror { - margin-bottom: .875rem; + margin-bottom: .5em; box-sizing: border-box; } /* deleted section */ @@ -576,13 +576,21 @@ body:not(.find-open) [data-match-highlight-count="1"] .CodeMirror-selection-high background-color: #f002; border-color: #f008; } -[i18n-text="appliesLabel"] { +.applies-to label { font-size: 0; padding: 0; margin-left: -24px; position: absolute; line-height: var(--input-height); } +.compact-layout .applies-to label { + display: none; +} +.compact-layout .applies-to[data-all] label { + position: static; + display: inline; + margin: 0 6px 0 -4px; +} .applies-to ul { flex: auto; flex-grow: 1; diff --git a/edit/sections-editor-section.js b/edit/sections-editor-section.js index a8cee631..8af726e0 100644 --- a/edit/sections-editor-section.js +++ b/edit/sections-editor-section.js @@ -1,4 +1,4 @@ -/* global $ */// dom.js +/* global $ toggleDataset */// dom.js /* global MozDocMapper trimCommentLabel */// util.js /* global cmFactory */ /* global debounce tryRegExp */// toolbox.js @@ -35,7 +35,8 @@ function createSection(originalSection, genId, si) { const changeListeners = new Set(); - const appliesToContainer = $('.applies-to-list', el); + const appliesToContainer = $('.applies-to', el); + const appliesToList = $('.applies-to-list', el); const appliesTo = []; MozDocMapper.forEachProp(originalSection, (type, value) => insertApplyAfter({type, value})); @@ -234,7 +235,8 @@ function createSection(originalSection, genId, si) { function insertApplyAfter(init, base) { const apply = createApply(init); appliesTo.splice(base ? appliesTo.indexOf(base) + 1 : appliesTo.length, 0, apply); - appliesToContainer.insertBefore(apply.el, base ? base.el.nextSibling : null); + appliesToList.insertBefore(apply.el, base ? base.el.nextSibling : null); + toggleDataset(appliesToContainer, 'all', init.all); dirty.add(apply, apply); if (appliesTo.length > 1 && appliesTo[0].all) { removeApply(appliesTo[0]); @@ -251,6 +253,7 @@ function createSection(originalSection, genId, si) { dirty.remove(apply, apply); if (!appliesTo.length) { insertApplyAfter({all: true}); + toggleDataset(appliesToContainer, 'all', true); } emitSectionChange('apply'); }