/** * @requires $ jQuery * @requires _ UnderscoreJS */ (function (/* Object */ ns) { "use strict"; ns.tribeSurcharge = function (options) { qs.FormNode.apply(this, arguments); this.init(); }; var proto = ns.tribeSurcharge.prototype = Object.create(qs.FormNode.prototype); proto.init = function () { this.get('useSurcharge').on('change', _.bind(this.onUseSurcharge, this)); }; proto.onUseSurcharge = function (event) { var element = event.currentTarget; var toggleElement = this.get('surcharge'); var toggleId = toggleElement.attr('id'); if (element.value == 'y') { $('label[for="' + toggleId + '"]').show(); $('#' + toggleId + '-element').show(); } else { $('label[for="' + toggleId + '"]').hide(); $('#' + toggleId + '-element').hide(); } }; })(qs.defineNS('app.license'));