Skip to content
Snippets Groups Projects
Commit 17cbb7d5 authored by Peter Rotich's avatar Peter Rotich
Browse files

Merge pull request #819 from greezybacon/feature/notes-hide-new


notes: Hide new note box when editing a note

Reviewed-By: default avatarPeter Rotich <peter@osticket.com>
parents 50687617 c18045af
No related branches found
No related tags found
No related merge requests found
......@@ -5,8 +5,10 @@ foreach ($notes as $note) {
include STAFFINC_DIR."templates/note.tmpl.php";
} ?>
</div>
<div id="new-note-box">
<div class="quicknote" id="new-note" data-url="<?php echo $create_note_url; ?>">
<div class="body">
<a href="#"><i class="icon-plus icon-large"></i> &nbsp; Click to create a new note</a>
</div>
</div>
</div>
......@@ -93,6 +93,7 @@ if ($info['error']) {
foreach ($notes as $note)
include STAFFINC_DIR . 'templates/note.tmpl.php';
?>
<div id="new-note-box">
<div class="quicknote no-options" id="new-note"
data-url="users/<?php echo $user->getId(); ?>/note">
<div class="body">
......@@ -100,6 +101,7 @@ foreach ($notes as $note)
</div>
</div>
</div>
</div>
</div>
<div id="user-form" style="display:<?php echo $forms ? 'block' : 'none'; ?>;">
......
......@@ -1718,6 +1718,10 @@ tr.disabled th {
background-color: rgba(255, 145, 0, 0.05);
border-radius: 3px;
}
.quicknote a.action.save-note,
.floating-options a.action.save-note {
background-color: #bbeebb;
}
#new-note {
margin-top: 10px;
}
......
......@@ -680,6 +680,7 @@ $('.quicknote .action.edit-note').live('click.note', function() {
note.find('.action.edit-note').hide();
note.find('.action.save-note').show();
note.find('.action.cancel-edit').show();
$('#new-note-box').hide();
return false;
});
$('.quicknote .action.cancel-edit').live('click.note', function() {
......@@ -692,6 +693,7 @@ $('.quicknote .action.cancel-edit').live('click.note', function() {
note.find('.action.save-note').hide();
note.find('.action.cancel-edit').hide();
note.find('.action.edit-note').show();
$('#new-note-box').show();
});
return false;
});
......@@ -707,6 +709,7 @@ $('.quicknote .action.save-note').live('click.note', function() {
note.find('.action.save-note').hide();
note.find('.action.cancel-edit').hide();
note.find('.action.edit-note').show();
$('#new-note-box').show();
},
'html'
);
......@@ -728,7 +731,6 @@ $('.quicknote .delete').live('click.note', function() {
});
$('#new-note').live('click', function() {
var note = $(this).closest('.quicknote'),
top = note.parent(),
T = $('<textarea>'),
button = $('<input type="button">').val('Create');
button.click(function() {
......@@ -736,7 +738,7 @@ $('#new-note').live('click', function() {
{ note: T.redactor('get'), no_options: note.hasClass('no-options') },
function(response) {
$(T).redactor('destroy').replaceWith(note);
$(response).show('highlight').insertBefore(note);
$(response).show('highlight').insertBefore(note.parent());
$('.submit', note.parent()).remove();
},
'html'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment