1
0

break.js 975 B

1234567891011121314151617181920212223242526
  1. import { LocalizedStrings } from '../../services/localizedStringsService';
  2. import * as CommandsManagement from '../commands';
  3. export function createFloatingCommand () {
  4. return $('<div class="ui comment created_element"> <i class="ui icon small quote left"></i> <span> '+LocalizedStrings.getUI('text_break')+' </span></div>');
  5. }
  6. export function renderCommand (command, function_obj) {
  7. var el = $('<div class="ui comment command_container"> <i class="ui icon small quote left"></i> <i class="ui icon times red button_remove_command"></i> <span>'+LocalizedStrings.getUI('text_break')+'</span> </div>');
  8. el.data('command', command);
  9. addHandlers(command, function_obj, el);
  10. return el;
  11. }
  12. function addHandlers (command, function_obj, break_dom) {
  13. break_dom.find('.button_remove_command').on('click', function() {
  14. if (CommandsManagement.removeCommand(command, function_obj, break_dom)) {
  15. break_dom.fadeOut(400, function() {
  16. break_dom.remove();
  17. });
  18. }
  19. });
  20. }