From 317da2f2a35ad3be3b61a8046641afeea025ff0d Mon Sep 17 00:00:00 2001 From: Jared Hancock <jared@osticket.com> Date: Tue, 14 Jul 2015 09:40:21 -0500 Subject: [PATCH] redactor: Fix notes api --- scp/js/scp.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scp/js/scp.js b/scp/js/scp.js index a97e1ef94..a15b0e64f 100644 --- a/scp/js/scp.js +++ b/scp/js/scp.js @@ -947,7 +947,7 @@ $(document).on('click.note', '.quicknote .action.edit-note', function() { T.addClass('no-bar small'); body.replaceWith(T); $.redact(T); - $(T).redactor('focus'); + $(T).redactor('focus.setStart'); note.find('.action.edit-note').hide(); note.find('.action.save-note').show(); note.find('.action.cancel-edit').show(); @@ -959,7 +959,7 @@ $(document).on('click.note', '.quicknote .action.cancel-edit', function() { T = note.find('textarea'), body = $('<div class="body">'); body.load('ajax.php/note/' + note.data('id'), function() { - try { T.redactor('destroy'); } catch (e) {} + try { T.redactor('core.destroy'); } catch (e) {} T.replaceWith(body); note.find('.action.save-note').hide(); note.find('.action.cancel-edit').hide(); @@ -972,10 +972,10 @@ $(document).on('click.note', '.quicknote .action.save-note', function() { var note = $(this).closest('.quicknote'), T = note.find('textarea'); $.post('ajax.php/note/' + note.data('id'), - { note: T.redactor('get') }, + { note: T.redactor('code.get') }, function(html) { var body = $('<div class="body">').html(html); - try { T.redactor('destroy'); } catch (e) {} + try { T.redactor('core.destroy'); } catch (e) {} T.replaceWith(body); note.find('.action.save-note').hide(); note.find('.action.cancel-edit').hide(); @@ -1006,9 +1006,9 @@ $(document).on('click', '#new-note', function() { button = $('<input type="button">').val(__('Create')); button.click(function() { $.post('ajax.php/' + note.data('url'), - { note: T.redactor('get'), no_options: note.hasClass('no-options') }, + { note: T.redactor('code.get'), no_options: note.hasClass('no-options') }, function(response) { - $(T).redactor('destroy').replaceWith(note); + $(T).redactor('core.destroy').replaceWith(note); $(response).show('highlight').insertBefore(note.parent()); $('.submit', note.parent()).remove(); }, @@ -1021,7 +1021,7 @@ $(document).on('click', '#new-note', function() { $('<p>').addClass('submit').css('text-align', 'center') .append(button).appendTo(T.parent()); $.redact(T); - $(T).redactor('focus'); + $(T).redactor('focus.setStart'); return false; }); -- GitLab