jQGrid: Add lazy load for languages #2803

pull/2819/head
Angel Fernando Quiroz Campos 6 years ago
parent 8d9581f495
commit dc8bbe4147
  1. 6
      assets/js/session_list.js
  2. 11
      main/session/session_list.php

@ -1,5 +1,7 @@
import 'free-jqgrid';
import 'free-jqgrid/css/ui.jqgrid.bootstrap4.css';
import(
/* webpackChunkName: "free-jqgrid/i18n/" */
'free-jqgrid/js/i18n/grid.locale-' + window.lang
);

@ -13,14 +13,11 @@ $cidReset = true;
require_once __DIR__.'/../inc/global.inc.php';
$this_section = SECTION_PLATFORM_ADMIN;
$router = Container::getRouter();
$routePublic = Container::getRouter()->generate('legacy_public');
$htmlHeadXtra[] = api_get_css(
$router->generate('legacy_public').'build/session_list.css'
);
$htmlHeadXtra[] = api_get_js_simple(
$router->generate('legacy_public').'build/session_list.js'
);
$htmlHeadXtra[] = "<script>window.lang = '".api_get_language_isocode()."';</script>";
$htmlHeadXtra[] = api_get_css($routePublic.'build/session_list.css');
$htmlHeadXtra[] = api_get_js_simple($routePublic.'build/session_list.js');
SessionManager::protectSession(null, false);

Loading…
Cancel
Save