summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/subscription_select.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/subscription_select.js')
-rw-r--r--app/assets/javascripts/subscription_select.js36
1 files changed, 36 insertions, 0 deletions
diff --git a/app/assets/javascripts/subscription_select.js b/app/assets/javascripts/subscription_select.js
new file mode 100644
index 00000000000..134f2a1c99b
--- /dev/null
+++ b/app/assets/javascripts/subscription_select.js
@@ -0,0 +1,36 @@
+// Generated by CoffeeScript 1.10.0
+(function() {
+ this.SubscriptionSelect = (function() {
+ function SubscriptionSelect() {
+ $('.js-subscription-event').each(function(i, el) {
+ var fieldName;
+ fieldName = $(el).data("field-name");
+ return $(el).glDropdown({
+ selectable: true,
+ fieldName: fieldName,
+ toggleLabel: (function(_this) {
+ return function(selected, el, instance) {
+ var $item, label;
+ label = 'Subscription';
+ $item = instance.dropdown.find('.is-active');
+ if ($item.length) {
+ label = $item.text();
+ }
+ return label;
+ };
+ })(this),
+ clicked: function(item, $el, e) {
+ return e.preventDefault();
+ },
+ id: function(obj, el) {
+ return $(el).data("id");
+ }
+ });
+ });
+ }
+
+ return SubscriptionSelect;
+
+ })();
+
+}).call(this);