JSFiddle - React, Tailwind, and code Playground
by Maxim Ivanov
JavaScript
app.controller('MainController', ['$scope', '$compile', '$http', '$timeout', 'dataService', '$rootScope', function($scope, $compile, $http, $timeout, dataService, $rootScope) {
/*
=======================================
ДАННЫЕ (ИСПОЛЬЗУЮЩИЕ МЕТКИ В СТРАНИЦЕ)
=======================================
*/
$scope.titlelogo = dataService.titlelogo.title;
$scope.title = dataService.title;
// по умолчанию пустые блоки
$scope.myprocessess = []; // мои процессы
$scope.myprocessstepnow = []; // мои шаги на исполнение
$scope.myprocessessstep = []; // мои шаги
/*
=======================================
CUSTOM FUNCTIONS
=======================================
*/
function clearToken(err){
console.log(err);
setTimeout (function(){
localStorage.removeItem('SecurityToken');
location.reload();
}, 2000);
$("main-content").addClass("hide");
$("html").addClass("preload");
}
$(".button-collapse").sideNav({
menuWidth: 300, // Default is 240
edge: 'left', // Choose the horizontal origin
closeOnClick: true // Closes side-nav on <a> clicks, useful for Angular/Meteor
}); // отображаем мобильное меню
$(".dropdown-button").dropdown(); // подключаем выпадающее меню профиля
$('.modal-trigger').leanModal({
opacity: 0.5, // Opacity of modal background
in_duration: 300, // Transition in duration
out_duration: 200, // Transition out duration
});
/*
=======================================
ПЕРВИЧНЫЕ ЗАПРОСЫ К СЕРВЕРУ
=======================================
*/
server.processtypes(function(req){ // получаем все процессы
$http.get(req).then(function(answer){
var data = answer.data;
var state = data.IsSuccessful;
$scope.processess = [];
if (state) { // если токен правильный, то данные успешно вернутся
var ProcessTypes = data.ProcessTypes;
if (ProcessTypes.length > 0) {
ProcessTypes.forEach(function(item,...