semantic-buttons.js 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. var button_ready = function() {
  2. var
  3. $buttons = $('.ivprog_format .button'),
  4. handler = {
  5. activate: function() {
  6. $(this)
  7. .addClass('active')
  8. .siblings()
  9. .removeClass('active')
  10. ;
  11. }
  12. }
  13. ;
  14. $buttons.on('click', handler.activate);
  15. $('.ivprog_format_info')
  16. .popup({
  17. popup : $('.custom.popup'),
  18. on : 'click'
  19. })
  20. ;
  21. $(".data_types_dropdown")
  22. .dropdown()
  23. ;
  24. $('.ui.dropdown')
  25. .dropdown()
  26. ;
  27. $('.program_signature_text').text(i18n('program'));
  28. $('.add_function_button').on('click', addFunctionHandler);
  29. // Atualiza a tela do algoritmo
  30. renderAlgorithm();
  31. $('.ivprog_visual_panel').removeClass("loading");
  32. //Sortable:
  33. Sortable.create(listWithHandle, {
  34. handle: '.glyphicon-move',
  35. animation: 100,
  36. ghostClass: 'ghost',
  37. group: 'functions_divs_drag',
  38. onEnd: function (evt) {
  39. updateSequenceFunctionHandler(evt.oldIndex, evt.newIndex);
  40. }
  41. });
  42. };
  43. // attach ready event
  44. $(document)
  45. .ready(button_ready)
  46. ;