/** * @requires $ jQuery * @requires _ UnderscoreJS */ (function (/* Object */ ns) { "use strict"; ns.selectTribeSurcharge = function (options) { qs.FormNode.apply(this, arguments); this.setOptions(options); this.init(); }; var proto = ns.selectTribeSurcharge.prototype = Object.create(qs.FormNode.prototype); proto.setOptions = function (options) { this.surchargeElementPrefix = options.surchargeElementPrefix; this.tribesElementPrefix = options.tribesElementPrefix; }; proto.init = function () { this.get('tribes').on('click', _.bind(this.onChangeTribe, this)); $('.autoNumeric').autoNumeric(); }; proto.onChangeTribe = function (event) { var element = event.currentTarget; var tribeId = element.id.replace(this.tribesElementPrefix, ''); if (element.checked) { $('#' + this.surchargeElementPrefix + tribeId + '-label').show(); $('#' + this.surchargeElementPrefix + tribeId + '-element').show(); } else { $('#' + this.surchargeElementPrefix + tribeId + '-label').hide(); $('#' + this.surchargeElementPrefix + tribeId + '-element').hide(); } }; })(qs.defineNS('app.license'));