check for special char

pull/3094/head
yann300 6 years ago
parent d8d1f9f5fb
commit 0fcf3ac3df
  1. 10
      src/app/components/vertical-icons-component.js

@ -1,5 +1,6 @@
var yo = require('yo-yo') var yo = require('yo-yo')
var csjs = require('csjs-inject') var csjs = require('csjs-inject')
var helper = require('../../lib/helper')
const EventEmitter = require('events') const EventEmitter = require('events')
@ -62,8 +63,8 @@ class VerticalIconComponent {
/** /**
* Set a new status for the @arg name * Set a new status for the @arg name
* @param {name} * @param {String} name
* @param {status} * @param {Object} status
*/ */
setIconStatus (name, status) { setIconStatus (name, status) {
const el = this.icons[name] const el = this.icons[name]
@ -73,7 +74,10 @@ class VerticalIconComponent {
el.removeChild(statusEl) el.removeChild(statusEl)
} }
if (status.key) { if (status.key) {
el.appendChild(yo`<i title="${status.title}" class="fa fa-${status.key} ${css.status} font-weight-bold text-${status.type}" aria-hidden="true"></i>`) let key = helper.checkSpecialChars(status.key) ? '' : status.key
let type = helper.checkSpecialChars(status.type) ? '' : status.type
let title = helper.checkSpecialChars(status.title) ? '' : status.title
el.appendChild(yo`<i title="${title}" class="fa fa-${key} ${css.status} text-${type}" aria-hidden="true"></i>`)
} }
} }

Loading…
Cancel
Save