Skip to content
Snippets Groups Projects
Commit 159dc1ff authored by LucasC's avatar LucasC Committed by Simon Urli
Browse files

XWIKI-21766: Notification preferences dropdown carets are not animated (#3300)

* Reworked the way hiding sections work to make it easier to handle with CSS (and also avoid inline styling...)
* Added style for the rotation
* Used mvn xar:format to escape properly the new content added in the .xml

(cherry picked from commit b952bda1)
parent a6016ce6
No related branches found
No related tags found
No related merge requests found
...@@ -349,8 +349,6 @@ ...@@ -349,8 +349,6 @@
* Initialization * Initialization
*/ */
self.init = function () { self.init = function () {
// Replace the 'hidden' class by a call to jQuery.hide();
self.domElement.removeClass('hidden').hide();
// Enable bootstrap switches // Enable bootstrap switches
$([self.switchAlert, self.switchEmail]).bootstrapSwitch({ $([self.switchAlert, self.switchEmail]).bootstrapSwitch({
size: 'mini', size: 'mini',
...@@ -394,13 +392,6 @@ ...@@ -394,13 +392,6 @@
self.switchEmail.bootstrapSwitch('state', state); self.switchEmail.bootstrapSwitch('state', state);
}; };
/**
* Hide/Show the event type widget
*/
self.toggleVisibility = function () {
self.domElement.toggle();
};
// Call init // Call init
self.init(); self.init();
}; };
...@@ -539,9 +530,7 @@ ...@@ -539,9 +530,7 @@
// Handle collapsing // Handle collapsing
// Make sure the click listener is registered only once. // Make sure the click listener is registered only once.
self.collapseButton.off('click.toggleVisibility').on('click.toggleVisibility', function() { self.collapseButton.off('click.toggleVisibility').on('click.toggleVisibility', function() {
for (var i = 0; i < self.eventTypes.length; ++i) { this.classList.toggle("collapsed")
self.eventTypes[i].toggleVisibility();
}
}); });
// Handle switch change // Handle switch change
...@@ -730,6 +719,19 @@ ...@@ -730,6 +719,19 @@
width: 250px; width: 250px;
} }
/* Hide all of the eventType rows that are after a category toggler that is in the collapsed state. */
.notifPreferences tr:has(> td > button.collapsed) ~ tr {
display: none;
}
.notifPreferences tr > td > button > *:first-child {
transition: transform .2s ease-in-out;
}
.notifPreferences tr > td > button.collapsed > *:first-child {
transform: rotate(90deg);
}
.notificationAppCell { .notificationAppCell {
vertical-align: top; vertical-align: top;
width: 33%; width: 33%;
...@@ -1050,7 +1052,7 @@ ...@@ -1050,7 +1052,7 @@
#end #end
## Collapse button ## Collapse button
<td class="notificationCollapseButtonCell"> <td class="notificationCollapseButtonCell">
<button type="button" class="btn btn-default btn-sm collapseButton"> <button type="button" class="btn btn-default btn-sm collapseButton collapsed">
$services.icon.renderHTML('caret-down') $services.icon.renderHTML('caret-down')
<span class='sr-only'> <span class='sr-only'>
$escapetool.xml($services.localization.render('notifications.settings.applications.table.dropdown.toggle.label',[$type.applicationName])) $escapetool.xml($services.localization.render('notifications.settings.applications.table.dropdown.toggle.label',[$type.applicationName]))
...@@ -1062,7 +1064,7 @@ ...@@ -1062,7 +1064,7 @@
## Display all events of this application ## Display all events of this application
## ##
#foreach($type in $app) #foreach($type in $app)
<tr class="rowEventType hidden" data-eventtype="$type.eventType"> <tr class="rowEventType" data-eventtype="$type.eventType">
<td>$escapetool.xml($type.description)</td> <td>$escapetool.xml($type.description)</td>
#displayPreference($type, 'alert') #displayPreference($type, 'alert')
#if ($services.notification.areEmailsEnabled()) #if ($services.notification.areEmailsEnabled())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment