implement foldable fieldset as in w.c.s. (fixes #9788)
This commit is contained in:
parent
6fa1dff90a
commit
fbab2ba7ca
|
@ -788,6 +788,31 @@ div.old-ie-warning p {
|
|||
margin: 0;
|
||||
line-height: 150%;
|
||||
}
|
||||
/* fieldsets */
|
||||
fieldset.gadjo-foldable legend.gadjo-foldable-widget {
|
||||
border-bottom: 1px solid #aaa;
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
font-weight: bold;
|
||||
padding: 1ex 0 0;
|
||||
width: 100%;
|
||||
}
|
||||
fieldset.gadjo-foldable legend.gadjo-foldable-widget:after {
|
||||
font-family: FontAwesome;
|
||||
content: "\f106"; /* angle-up */
|
||||
position: absolute;
|
||||
right: 1em;
|
||||
}
|
||||
fieldset.gadjo-foldable.gadjo-folded legend.gadjo-foldable-widget:after {
|
||||
content: "\f107"; /* angle-down */
|
||||
}
|
||||
fieldset.gadjo-foldable {
|
||||
padding: 1ex 0 0 0;
|
||||
border: 0;
|
||||
}
|
||||
.gadjo-foldable.gadjo-folded > .gadjo-folding {
|
||||
display: none;
|
||||
}
|
||||
|
||||
ul#sidepage-menu li a.icon-add { background-image: url(icons/add.small.png); }
|
||||
ul#sidepage-menu li a.icon-calendar { background-image: url(icons/calendar.small.png); }
|
||||
|
|
|
@ -240,4 +240,22 @@
|
|||
}
|
||||
}
|
||||
});
|
||||
$(function () {
|
||||
function gadjo_unfold_saved() {
|
||||
$('.gadjo-folded').each(function (idx, elem) {
|
||||
if (elem.id && sessionStorage['gadjo-foldable-id-' + elem.id + '-' + window.location.pathname] == "true") {
|
||||
$(elem).removeClass('gadjo-folded');
|
||||
}
|
||||
});
|
||||
}
|
||||
gadjo_unfold_saved()
|
||||
$(document).on('gadjo:content-update', gadjo_unfold_saved);
|
||||
$('body').on('click', '.gadjo-foldable-widget', function (event) {
|
||||
var $parent = $(event.target).closest('.gadjo-foldable');
|
||||
$parent.toggleClass('gadjo-folded');
|
||||
if ($parent[0].id) {
|
||||
sessionStorage['gadjo-foldable-id-' + $parent[0].id + '-' + window.location.pathname] = ! $parent.is('.gadjo-folded');
|
||||
}
|
||||
});
|
||||
});
|
||||
})();
|
||||
|
|
Loading…
Reference in New Issue