From c23a9f955a109f49971b6d65c929e3ff49c39f1c Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Fri, 29 Jul 2016 13:54:15 -0400 Subject: [PATCH] (html) Allow sorting the actions of a Sieve filter --- NEWS | 1 + UI/Templates/PreferencesUI/UIxFilterEditor.wox | 11 ++++++++++- UI/Templates/PreferencesUI/UIxPreferences.wox | 5 ++--- UI/WebServerResources/scss/components/list/list.scss | 5 ++++- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS index a24db3d0b..b33e85ef1 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,7 @@ Enhancements - [web] restored indicator in the top banner when a vacation message (auto-reply) is active - [web] removed animation when dragging an event to speed up rendering - [web] expunge drafts mailbox when a draft is sent and deleted + - [web] actions of Sieve filters are now sortable Bug fixes - [web] fixed refresh of addressbook when deleting one or many cards diff --git a/UI/Templates/PreferencesUI/UIxFilterEditor.wox b/UI/Templates/PreferencesUI/UIxFilterEditor.wox index 70b519345..ac9ba943b 100644 --- a/UI/Templates/PreferencesUI/UIxFilterEditor.wox +++ b/UI/Templates/PreferencesUI/UIxFilterEditor.wox @@ -108,8 +108,16 @@

+
+ ng-repeat="action in filterEditor.filter.actions" + as-sortable-item="as-sortable-item"> + + drag_handle + @@ -170,6 +178,7 @@
+
diff --git a/UI/Templates/PreferencesUI/UIxPreferences.wox b/UI/Templates/PreferencesUI/UIxPreferences.wox index 18f86eaf0..db97ab9d9 100644 --- a/UI/Templates/PreferencesUI/UIxPreferences.wox +++ b/UI/Templates/PreferencesUI/UIxPreferences.wox @@ -674,11 +674,10 @@ - +
+ as-sortable="{ scrollableContainer: '.sg-list-sortable', containment: '.sg-list-sortable', containerPositioning: 'relative', orderChanged: preferencesForm.$setDirty }">
diff --git a/UI/WebServerResources/scss/components/list/list.scss b/UI/WebServerResources/scss/components/list/list.scss index 35c898ec4..d77ee4536 100644 --- a/UI/WebServerResources/scss/components/list/list.scss +++ b/UI/WebServerResources/scss/components/list/list.scss @@ -239,7 +239,8 @@ div.md-tile-left { * 1. We hide sortable handles when not inside a .sg-list-sortable; * 2. Elements wih the class .sg-list-sortable-hide are hidden when the list is * currently sortable; - * 3. Dragged element is highligh with a whiteframe. + * 3. Dragged element is highligh with a whiteframe. We constraint the movement + * vertically; it also eliminates a flicker when dragging starts. * * See https://github.com/a5hik/ng-sortable */ @@ -261,6 +262,7 @@ div.md-tile-left { } .sg-list-sortable { + position: relative; .as-sortable-item-handle { cursor: move; display: block; /* [1] */ @@ -272,6 +274,7 @@ div.md-tile-left { .as-sortable-drag { /* [3] */ @extend .md-whiteframe-1dp; + left: 0 !important; background-color: rgba(255,255,255,0.4); position: absolute; pointer-events: none;