mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-21 13:31:54 +00:00
Refactored field animation and better block delete transition
This commit is contained in:
parent
bad069ffb8
commit
c73c8bc44e
3 changed files with 10 additions and 13 deletions
|
|
@ -44,7 +44,7 @@ CODE FOR SETTING UP SPECIFIC UI WIDGETS, SUCH AS DELETE BUTTONS OR MENUS, DOES N
|
|||
/* set this list member's hidden 'deleted' flag to true */
|
||||
$('#' + self.prefix + '-deleted').val('1');
|
||||
/* hide the list item */
|
||||
self.container.fadeOut();
|
||||
self.container.slideUp().dequeue().fadeOut();
|
||||
};
|
||||
|
||||
self._markAdded = function() {
|
||||
|
|
|
|||
|
|
@ -34,9 +34,6 @@ function makeRichTextEditable(id) {
|
|||
|
||||
var closestObj = input.closest('.object');
|
||||
|
||||
/* Events for when CSS transitions end, for various browsers */
|
||||
var transitionEvents = 'webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend';
|
||||
|
||||
richText.hallo({
|
||||
toolbar: 'halloToolbarFixed',
|
||||
toolbarCssClass: (closestObj.hasClass('full')) ? 'full' : (closestObj.hasClass('stream-field')) ? 'stream-field' : '',
|
||||
|
|
@ -49,17 +46,18 @@ function makeRichTextEditable(id) {
|
|||
}
|
||||
}).bind('paste', function(event, data) {
|
||||
setTimeout(removeStyling, 1);
|
||||
/* Reset the position of Hallo toolbar after the input boxes finish resizing */
|
||||
/* Animate the fields open when you click into them. */
|
||||
}).bind('halloactivated', function(event, data) {
|
||||
$(event.target).one(transitionEvents, function(e) {
|
||||
data.turnOn();
|
||||
$(event.target).addClass('expanded', 200, function(e) {
|
||||
/* Hallo's toolbar will reposition itself on the scroll event.
|
||||
This is useful since animating the fields can cause it to be
|
||||
positioned badly initially. */
|
||||
$(window).trigger('scroll');
|
||||
});
|
||||
$(event.target).addClass('expanded');
|
||||
}).bind('hallodeactivated', function(event, data) {
|
||||
$(event.target).one(transitionEvents, function(e) {
|
||||
data.turnOff();
|
||||
$(event.target).removeClass('expanded', 200, function(e) {
|
||||
$(window).trigger('scroll');
|
||||
});
|
||||
$(event.target).removeClass('expanded');
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -130,7 +130,6 @@
|
|||
.richtext{
|
||||
padding-top:1em; /* to provide space for editor buttons */
|
||||
padding-bottom:1em;
|
||||
@include transition(padding .2s ease);
|
||||
|
||||
&.expanded{
|
||||
padding-top:5em; /* to provide space for editor buttons */
|
||||
|
|
@ -169,7 +168,7 @@
|
|||
padding-top:3em; /* to provide space for editor buttons */
|
||||
padding-bottom:3em;
|
||||
|
||||
&.inEditMode{
|
||||
&.expanded{
|
||||
padding-top:5em; /* to provide space for editor buttons */
|
||||
padding-bottom:5em;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue