From b0452ca47d6af44646b1a71002261c996a65caa5 Mon Sep 17 00:00:00 2001 From: Felix Niklas Date: Thu, 18 Sep 2014 00:04:49 +0200 Subject: [PATCH 1/3] add white arrows --- app/assets/images/sprite.svg | 14 ++++++++------ app/assets/stylesheets/zzz.css.erb | 16 ++++++++++++---- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/app/assets/images/sprite.svg b/app/assets/images/sprite.svg index b2d570a41..5bef08338 100644 --- a/app/assets/images/sprite.svg +++ b/app/assets/images/sprite.svg @@ -103,15 +103,15 @@ - - - - + + + + - - + + @@ -166,5 +166,7 @@ + + \ No newline at end of file diff --git a/app/assets/stylesheets/zzz.css.erb b/app/assets/stylesheets/zzz.css.erb index de09bd532..62bc3982e 100644 --- a/app/assets/stylesheets/zzz.css.erb +++ b/app/assets/stylesheets/zzz.css.erb @@ -1132,12 +1132,20 @@ ol.tabs li { background-position: -8px -299px; } + .white.left.arrow.icon { + background-position: -16px -299px; + } + + .white.right.arrow.icon { + background-position: -24px -299px; + } + .checkbox.icon { min-height: 0; /* overwriting bootstrap */ margin: 0; /* overwriting bootstrap */ width: 10px; height: 10px; - background-position: -16px -299px; + background-position: -32px -299px; } .white.checkbox.icon { @@ -1145,19 +1153,19 @@ ol.tabs li { } :checked + .checkbox.icon { - background-position: -26px -299px; + background-position: -42px -299px; } .arrow-right.icon { width: 12px; height: 11px; - background-position: -36px -299px; + background-position: -52px -299px; } .delete.icon { width: 9px; height: 9px; - background-position: -48px -300px; + background-position: -64px -300px; } .dark.group.icon { From 9acad47838c515f4134764e69da2abb297fa75ac Mon Sep 17 00:00:00 2001 From: Felix Niklas Date: Thu, 18 Sep 2014 00:05:12 +0200 Subject: [PATCH 2/3] add organisationList to recipientList with fade animation and back button --- .../controllers/agent_ticket_create.js.coffee | 56 +++++++- .../app/views/agent_ticket_create.jst.eco | 131 +++++++++++------- app/assets/stylesheets/zzz.css.erb | 120 ++++++++++------ 3 files changed, 212 insertions(+), 95 deletions(-) diff --git a/app/assets/javascripts/app/controllers/agent_ticket_create.js.coffee b/app/assets/javascripts/app/controllers/agent_ticket_create.js.coffee index 6dbdb7f49..19fff5eca 100644 --- a/app/assets/javascripts/app/controllers/agent_ticket_create.js.coffee +++ b/app/assets/javascripts/app/controllers/agent_ticket_create.js.coffee @@ -1,6 +1,6 @@ class App.TicketCreate extends App.Controller elements: - '.tabsSidebar' : 'sidebar' + '.tabsSidebar' : 'sidebar' events: 'click .type-tabs .tab': 'changeFormType' @@ -8,6 +8,8 @@ class App.TicketCreate extends App.Controller 'submit form': 'submit' 'click .submit': 'submit' 'click .cancel': 'cancel' + 'click .js-organisation': 'showOrganisationMembers' + 'click .js-back': 'hideOrganisationMembers' constructor: (params) -> super @@ -37,6 +39,58 @@ class App.TicketCreate extends App.Controller @log 'notice', 'error', defaults @render(defaults) + showOrganisationMembers: (e) => + e.stopPropagation() + + list = @$('.recipientList') + organisationList = @$('.recipientList-organisationMembers') + + # move organisation-list to the right and slide it in + + $.Velocity.hook(organisationList, 'translateX', '100%') + organisationList.removeClass('hide') + + organisationList.velocity + properties: + translateX: 0 + options: + speed: 300 + + # fade out list + + list.velocity + properties: + translateX: '-100%' + options: + speed: 300 + complete: -> list.height(organisationList.height()) + + hideOrganisationMembers: (e) => + e && e.stopPropagation() + list = @$('.recipientList') + organisationList = @$('.recipientList-organisationMembers') + + # fade list back in + + list.velocity + properties: + translateX: 0 + options: + speed: 300 + + # reset list height + + list.height('') + + # slide out organisation-list and hide it + + organisationList.velocity + properties: + translateX: '100%' + options: + speed: 300 + complete: -> organisationList.addClass('hide') + changeFormType: (e) => type = $(e.target).data('type') if !type diff --git a/app/assets/javascripts/app/views/agent_ticket_create.jst.eco b/app/assets/javascripts/app/views/agent_ticket_create.jst.eco index c7649b624..729c936c5 100644 --- a/app/assets/javascripts/app/views/agent_ticket_create.jst.eco +++ b/app/assets/javascripts/app/views/agent_ticket_create.jst.eco @@ -27,129 +27,154 @@
-