Sfoglia il codice sorgente

Add basic mechanism to skip terms if previously read

tags/v0.4.3^2
Vildravn 4 anni fa
parent
commit
5f3b9408a9
2 ha cambiato i file con 15 aggiunte e 4 eliminazioni
  1. +2
    -1
      src/client/js/config.js
  2. +13
    -3
      src/client/ui/templates/terms/terms.js

+ 2
- 1
src/client/js/config.js Vedi File

@@ -10,7 +10,8 @@ define([
playAudio: true,
qualityIndicators: 'off',
unusableIndicators: 'off',
rememberChatChannel: true
rememberChatChannel: true,
readTos: false
};

const valueChains = {


+ 13
- 3
src/client/ui/templates/terms/terms.js Vedi File

@@ -4,29 +4,39 @@ define([
'ui/factory',
'html!ui/templates/terms/template',
'css!ui/templates/terms/styles',
'js/rendering/renderer'
'js/rendering/renderer',
'js/config'
], function (
events,
client,
uiFactory,
template,
styles,
renderer
renderer,
config
) {
return {
tpl: template,
centered: true,
centered: true,

postRender: function () {
this.tryAutoAccept();

this.find('.btnCancel').on('click', this.cancel.bind(this));
this.find('.btnAccept').on('click', this.accept.bind(this));
},

tryAutoAccept: function () {
if (config.readTos)
this.accept();
},
cancel: function () {
window.location = window.location;
},
accept: function () {
config.set('readTos', true);
this.destroy();
uiFactory.build('characters', {});
}


Caricamento…
Annulla
Salva