-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #282 from City-of-Helsinki/UHF-9739
UHF-9739 Updating news
- Loading branch information
Showing
9 changed files
with
83 additions
and
5 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* @file | ||
* Updating news field group auto toggle if there is content. | ||
*/ | ||
|
||
(function (once) { | ||
|
||
'use strict'; | ||
|
||
const updatingNews = once( | ||
'updating-news-auto-toggle', | ||
'[data-drupal-selector="edit-group-updating-news"]' | ||
); | ||
|
||
if (updatingNews.length === 0) { | ||
return; | ||
} | ||
|
||
updatingNews.forEach(details => { | ||
const updatingNewsContent = details.querySelector( | ||
'table.field-news-item-updating-news-values > tbody' | ||
); | ||
|
||
if (updatingNewsContent) { | ||
details.open = true; | ||
} | ||
}); | ||
})(once); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,5 @@ | |
@import 'library'; | ||
@import 'liftup-with-image'; | ||
@import 'list-of-links'; | ||
@import 'news-update'; | ||
@import 'text'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Hide news item updating news paragraph label as it's obsolete in field group. | ||
.field-news-item-updating-news-values > thead { | ||
display: none; | ||
} | ||
|
||
// Hide news update paragraph field label as it's only taking extra space in UI. | ||
.field-news-update-values > thead { | ||
display: none; | ||
} | ||
|
||
// Remove extra margins, padding and borders from | ||
// the date picker field wrapper and labels. | ||
.hdbt-admin .field--name-field-news-update-date > fieldset { | ||
border: 0; | ||
margin-bottom: 0; | ||
padding: 0; | ||
|
||
// Unify the font-size of the date-picker field label. | ||
.fieldset__label { | ||
font-size: remify(16px) !important; | ||
line-height: 1.5 !important; | ||
padding: 0; | ||
} | ||
|
||
// Remove side margins from fieldset wrapper. | ||
.fieldset__wrapper { | ||
margin-left: 0; | ||
margin-right: 0; | ||
} | ||
|
||
// Remove all margins from datetime wrapper and datetime label. | ||
.fieldset__wrapper .form-datetime-wrapper, | ||
.form-item.form-item--no-label { | ||
margin: 0; | ||
} | ||
} |