'use strict';
/** Define UI specific stuff.
*/
var FastClick = require("fastclick");
var Cookies = require("js-cookie");
var UI = module.exports = (function (FastClick,Cookies) {
/** Introduce FastClick for faster clicking on mobile.
*/
$(function() {
FastClick.attach(document.body);
});
// $('.prevent-select').on('mousedown', function(e) {
// e.preventDefault();
// });
/** Show a bootstrap modal with dynamic content e.g. background info **/
var showModal = function(title, text, level) {
var $modal = $('#infoBox');
$modal.find('#infoBoxLabel').html(title);
$modal.find('.modal-body').html(text);
$modal.modal({show: true});
};
/** Display only the elements with data-min-level above a certain
* threshold.
*/
var showLevels = function(level) {
$('#infoBox').find('[data-min-level]').each(function() {
if (level >= $(this).data('min-level')) {
$(this).show();
} else {
$(this).hide();
}
});
};
var showUpdateValue = function(ident, num) {
if (num != 0) {
var formatted = Helpers.formatNumberPostfix(num);
var insert;
if (num > 0) {
insert = $("