Sha256: 7c38cc96aa2500e198341b65571e8d77dacf11d9ba23f5c5addd15faa9f03750
Contents?: true
Size: 756 Bytes
Versions: 153
Compression:
Stored size: 756 Bytes
Contents
Spree.Views.NumberWithCurrency = Backbone.View.extend({ events: { 'change input,select': "render" }, initialize: function() { this.$currencySelector = this.$('.number-with-currency-select'); }, getCurrency: function() { if (this.$currencySelector.length) { return this.$currencySelector.find('option:selected').val(); } else { return this.$('[data-currency]').data("currency"); } }, getCurrencySymbol: function() { var currency = this.getCurrency(); if (currency) { var currencyInfo = Spree.currencyInfo[currency]; return currencyInfo[0]; } else { return ''; } }, render: function() { this.$('.number-with-currency-symbol').text(this.getCurrencySymbol()); } });
Version data entries
153 entries across 153 versions & 2 rubygems