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