I"™ (function() { Turbolinks.enableProgressBar(); this.app = angular.module('push_type', ['ui.tree']); this.app.run([ '$http', function($http) { $http.defaults.headers.common['Accept'] = 'application/json'; return $http.defaults.headers.common['Content-Type'] = 'application/json'; } ]); this.app.directive('sidePanel', function() { return function(scope, $el, attrs) { return $el.sticky({ topSpacing: 80, getWidthFrom: '.sticky-wrapper', responsiveWidth: true }); }; }); $(document).on('ready page:load', function() { $(document).foundation(); angular.bootstrap($('[role="main"]'), ['push_type']); $('.node-list.sortable').sortable({ handle: '.handle', forcePlaceholderSize: true }).on('sortupdate', function(e, ui) { var obj; obj = { prev: ui.item.prev().data('id'), next: ui.item.next().data('id') }; return $.post("/push_type/nodes/" + (ui.item.data('id')) + "/position", obj, 'json'); }); $(document).confirmWithReveal(); $('input', '.date').pickadate({ format: 'd mmmm yyyy', formatSubmit: 'yyyy-mm-dd', hiddenName: true }); $('input', '.time').pickatime({ format: 'h:i A', formatSubmit: 'HH:i', formatLabel: 'h:i A HH:i', hiddenName: true }); $('select', '.select').selectize({ plugins: ['remove_button'], hideSelected: false }); $('select', '.taxonomy').selectize({ plugins: ['remove_button'], hideSelected: false, onInitialize: function() { var items, options, sel; sel = this; options = sel.$input.data('options'); items = sel.$input.data('items'); $.each(options, function() { return sel.addOption(this); }); if ($.isArray(items)) { return $.each(items, function() { return sel.addItem(this); }); } else { return sel.addItem(items); } }, render: { option: function(item, esc) { var pre; pre = item.depth > 0 ? '- '.repeat(item.depth) : ''; return "
" + pre + (esc(item.text)) + "
"; } } }); return $('select', '.tag_list').selectize({ plugins: ['remove_button', 'drag_drop'], create: true, persist: false }); }); }).call(this); :ET