In JS, TPS -> DS

This commit is contained in:
gregoirenovel 2018-02-28 16:07:52 +01:00 committed by Mathieu Magnin
parent 1b8b6a3274
commit 17421e54cc
13 changed files with 21 additions and 21 deletions

View file

@ -1,3 +1,3 @@
TPS.toggleCondidentielExplanation = function(event) { DS.toggleCondidentielExplanation = function(event) {
$(".confidentiel-explanation").toggle(); $(".confidentiel-explanation").toggle();
} }

View file

@ -2,7 +2,7 @@ $(document).on("click", "body", function () {
$(".print-menu").removeClass("open fade-in-down"); $(".print-menu").removeClass("open fade-in-down");
}); });
TPS.togglePrintMenu = function(event) { DS.togglePrintMenu = function(event) {
event.stopPropagation(); event.stopPropagation();
$(".print-menu").toggleClass("open fade-in-down"); $(".print-menu").toggleClass("open fade-in-down");
} }

View file

@ -2,7 +2,7 @@ $(document).on("click", "body", function () {
$(".header-menu").removeClass("open fade-in-down"); $(".header-menu").removeClass("open fade-in-down");
}); });
TPS.toggleHeaderMenu = function(event) { DS.toggleHeaderMenu = function(event) {
event.stopPropagation(); event.stopPropagation();
$(".header-menu").toggleClass("open fade-in-down"); $(".header-menu").toggleClass("open fade-in-down");
} }

View file

@ -1,2 +1,2 @@
// namespace // namespace
window.TPS = window.TPS || {}; window.DS = window.DS || {};

View file

@ -1,4 +1,4 @@
TPS.scrollMessagerie = function () { DS.scrollMessagerie = function () {
var scrollTo = function ($container, $scrollTo) { var scrollTo = function ($container, $scrollTo) {
$container.scrollTop( $container.scrollTop(
$scrollTo.offset().top - $container.offset().top + $container.scrollTop() $scrollTo.offset().top - $container.offset().top + $container.scrollTop()
@ -21,4 +21,4 @@ TPS.scrollMessagerie = function () {
} }
}; };
document.addEventListener("turbolinks:load", TPS.scrollMessagerie); document.addEventListener("turbolinks:load", DS.scrollMessagerie);

View file

@ -1,9 +1,9 @@
TPS.showMotivation = function (state) { DS.showMotivation = function (state) {
$(".motivation." + state).show(); $(".motivation." + state).show();
$(".dropdown-items").hide(); $(".dropdown-items").hide();
}; };
TPS.motivationCancel = function () { DS.motivationCancel = function () {
$(".motivation").hide(); $(".motivation").hide();
$(".dropdown-items").show(); $(".dropdown-items").show();
}; };

View file

@ -1,4 +1,4 @@
TPS.toggleChart = function(event, chartClass) { DS.toggleChart = function(event, chartClass) {
var nextSelectorItem = $(event.target), var nextSelectorItem = $(event.target),
nextChart = $(chartClass), nextChart = $(chartClass),
nextChartId = nextChart.children().first().attr("id"), nextChartId = nextChart.children().first().attr("id"),

View file

@ -47,7 +47,7 @@
- if gestionnaire_signed_in? || user_signed_in? - if gestionnaire_signed_in? || user_signed_in?
%li %li
.header-menu-opener .header-menu-opener
= image_tag "icons/account-circle.svg", onclick: "javascript:TPS.toggleHeaderMenu(event);", title: "Mon compte" = image_tag "icons/account-circle.svg", onclick: "javascript:DS.toggleHeaderMenu(event);", title: "Mon compte"
%ul.header-menu %ul.header-menu
%li %li
.menu-item{ title: current_email } .menu-item{ title: current_email }

View file

@ -7,13 +7,13 @@
%li %li
= "Dossier nº #{dossier.id}" = "Dossier nº #{dossier.id}"
.mixed-buttons-bar .mixed-buttons-bar
.button.dropdown.icon-only.print-menu-opener{ onclick: "javascript:TPS.togglePrintMenu(event);" } .button.dropdown.icon-only.print-menu-opener{ onclick: "javascript:DS.togglePrintMenu(event);" }
%span.icon.printer %span.icon.printer
%ul.print-menu %ul.print-menu
%li %li
= link_to "Tout le dossier", print_gestionnaire_dossier_path(dossier.procedure, dossier), target: "_blank", class: "menu-item menu-link" = link_to "Tout le dossier", print_gestionnaire_dossier_path(dossier.procedure, dossier), target: "_blank", class: "menu-item menu-link"
%li %li
= link_to "Uniquement cet onglet", "#", onclick: "TPS.togglePrintMenu; window.print()", class: "menu-item menu-link" = link_to "Uniquement cet onglet", "#", onclick: "DS.togglePrintMenu; window.print()", class: "menu-item menu-link"
= render partial: "new_gestionnaire/procedures/dossier_actions", locals: { procedure: dossier.procedure, dossier: dossier, dossier_is_followed: current_gestionnaire&.follow?(dossier) } = render partial: "new_gestionnaire/procedures/dossier_actions", locals: { procedure: dossier.procedure, dossier: dossier, dossier_is_followed: current_gestionnaire&.follow?(dossier) }
= render partial: "state_button", locals: { dossier: dossier } = render partial: "state_button", locals: { dossier: dossier }

View file

@ -28,17 +28,17 @@
.description .description
%h4 En instruction %h4 En instruction
L'usager ne peut modifier son dossier pendant l'instruction L'usager ne peut modifier son dossier pendant l'instruction
%li{ onclick: "TPS.showMotivation('accept');" } %li{ onclick: "DS.showMotivation('accept');" }
%span.icon.accept %span.icon.accept
.description .description
%h4 Accepter %h4 Accepter
L'usager sera notifié que son dossier a été accepté L'usager sera notifié que son dossier a été accepté
%li{ onclick: "TPS.showMotivation('without-continuation');" } %li{ onclick: "DS.showMotivation('without-continuation');" }
%span.icon.without-continuation %span.icon.without-continuation
.description .description
%h4 Classer sans suite %h4 Classer sans suite
L'usager ne recevra aucune notification L'usager ne recevra aucune notification
%li{ onclick: "TPS.showMotivation('refuse');" } %li{ onclick: "DS.showMotivation('refuse');" }
%span.icon.refuse %span.icon.refuse
.description .description
%h4 Refuser %h4 Refuser

View file

@ -9,5 +9,5 @@
%p.help %p.help
L'acceptation du dossier envoie automatiquement une attestation à l'usager. L'acceptation du dossier envoie automatiquement une attestation à l'usager.
.text-right .text-right
%span.button{ onclick: 'TPS.motivationCancel();' } Annuler %span.button{ onclick: 'DS.motivationCancel();' } Annuler
= button_tag 'Valider la décision', name: :process_action, value: process_action, class: 'button primary', title: title, data: { confirm: confirm } = button_tag 'Valider la décision', name: :process_action, value: process_action, class: 'button primary', title: title, data: { confirm: confirm }

View file

@ -16,7 +16,7 @@
- else - else
.confidentiel-wrapper .confidentiel-wrapper
= f.label :confidentiel, 'Cet avis est' = f.label :confidentiel, 'Cet avis est'
= f.select :confidentiel, [['partagé avec les autres experts', false], ['confidentiel', true]], {}, onchange: "javascript:TPS.toggleCondidentielExplanation(event);" = f.select :confidentiel, [['partagé avec les autres experts', false], ['confidentiel', true]], {}, onchange: "javascript:DS.toggleCondidentielExplanation(event);"
.confidentiel-explanation .confidentiel-explanation
Il ne sera pas affiché aux autres experts consultés mais sera visible par les accompagnateurs Il ne sera pas affiché aux autres experts consultés mais sera visible par les accompagnateurs
.send-wrapper .send-wrapper

View file

@ -15,9 +15,9 @@
.stat-card.stat-card-half.pull-left .stat-card.stat-card-half.pull-left
%ul.segmented-control.pull-right %ul.segmented-control.pull-right
%li.segmented-control-item.segmented-control-item-active{ :onclick => "TPS.toggleChart(event, '.monthly-procedures-chart');" } %li.segmented-control-item.segmented-control-item-active{ :onclick => "DS.toggleChart(event, '.monthly-procedures-chart');" }
Par mois Par mois
%li.segmented-control-item{ :onclick => "TPS.toggleChart(event, '.cumulative-procedures-chart');" } %li.segmented-control-item{ :onclick => "DS.toggleChart(event, '.cumulative-procedures-chart');" }
Cumul Cumul
%span.stat-card-title.pull-left Procédures dématérialisées %span.stat-card-title.pull-left Procédures dématérialisées
.clearfix .clearfix
@ -30,9 +30,9 @@
.stat-card.stat-card-half.pull-left .stat-card.stat-card-half.pull-left
%ul.segmented-control.pull-right %ul.segmented-control.pull-right
%li.segmented-control-item.segmented-control-item-active{ :onclick => "TPS.toggleChart(event, '.monthly-dossiers-chart');" } %li.segmented-control-item.segmented-control-item-active{ :onclick => "DS.toggleChart(event, '.monthly-dossiers-chart');" }
Par mois Par mois
%li.segmented-control-item{ :onclick => "TPS.toggleChart(event, '.cumulative-dossiers-chart');" } %li.segmented-control-item{ :onclick => "DS.toggleChart(event, '.cumulative-dossiers-chart');" }
Cumul Cumul
%span.stat-card-title.pull-left Dossiers déposés %span.stat-card-title.pull-left Dossiers déposés
.clearfix .clearfix