Projet

Général

Profil

0001-gadjo-add-progressive-rendering-of-publik-menu-7996.patch

Frédéric Péters, 16 septembre 2015 18:53

Télécharger (2,4 ko)

Voir les différences:

Subject: [PATCH] gadjo: add progressive rendering of publik menu (#7996)

 data/themes/gadjo/static/js/agent-portal.js |  7 +++++++
 data/themes/gadjo/static/js/publik.js       | 17 ++++-------------
 2 files changed, 11 insertions(+), 13 deletions(-)
data/themes/gadjo/static/js/agent-portal.js
1 1
$(function() {
2 2
  $(document).on('publik:environment-loaded', function(event, services) {
3
    /* empty all apps cells */
4
    var service_ids = Array('authentic', 'wcs', 'combo', 'passerelle', 'hobo');
5
    $(service_ids).each(function(index, service_id) {
6
      $('#portal-agent-content div.services-' + service_id + ' ul.apps').empty();
7
    });
8
    $('#portal-agent-content div.services ul.apps').empty();
9
    /* and fill them with current services */
3 10
    $(services.services).each(function(index, element) {
4 11
      var $content = $('#portal-agent-content div.services-' + element.service_id);
5 12
      if ($content.length === 0) {
data/themes/gadjo/static/js/publik.js
4 4
  var all_done = false;
5 5

  
6 6
  function check_all_done() {
7
    var local_done = true;
8
    $(COMBO_KNOWN_SERVICES).each(function(index, service) {
9
      if (service.data === undefined) {
10
        local_done = false;
11
      }
12
    });
13
    all_done = local_done;
14
    if (all_done) {
15
      window.sessionStorage.hobo_environment = JSON.stringify(COMBO_KNOWN_SERVICES);
16
      window.sessionStorage.hobo_environment_timestamp = Date.now();
17
      create_menu_items();
18
      $(document).trigger('publik:environment-loaded', {services: COMBO_KNOWN_SERVICES});
19
    }
7
    window.sessionStorage.hobo_environment = JSON.stringify(COMBO_KNOWN_SERVICES);
8
    window.sessionStorage.hobo_environment_timestamp = Date.now();
9
    create_menu_items();
10
    $(document).trigger('publik:environment-loaded', {services: COMBO_KNOWN_SERVICES});
20 11
  }
21 12

  
22 13
  function create_menu_items() {
23
-