1
0

semantic-buttons.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. $(document).mousemove(function(e){
  33. var parentOffset = $('.ivprog_visual_panel').offset();;
  34. mouseX = e.pageX - parentOffset.left + 300;
  35. mouseY = e.pageY - parentOffset.top + 100;
  36. /*$('.created_element').css('top', mouseY);
  37. $('.created_element').css('left', mouseX);*/
  38. });
  39. //Sortable:
  40. Sortable.create(listWithHandle, {
  41. handle: '.glyphicon-move',
  42. animation: 100,
  43. ghostClass: 'ghost',
  44. group: 'functions_divs_drag',
  45. onEnd: function (evt) {
  46. updateSequenceFunctionHandler(evt.oldIndex, evt.newIndex);
  47. }
  48. });
  49. };
  50. var mouseX;
  51. var mouseY;
  52. // attach ready event
  53. $(document)
  54. .ready(button_ready)
  55. ;