semantic-buttons.js 1.3 KB

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