diff --git a/include/staff/templates/notes.tmpl.php b/include/staff/templates/notes.tmpl.php index 360c519fe65d7752f80c5e45be7196b2d12f4e8a..1991c03b7c84a94e236ba882dcd18797f08abdf9 100644 --- a/include/staff/templates/notes.tmpl.php +++ b/include/staff/templates/notes.tmpl.php @@ -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> Click to create a new note</a> </div> </div> +</div> diff --git a/include/staff/templates/user.tmpl.php b/include/staff/templates/user.tmpl.php index 2aabe3ba5857d0cbecd5079ff7a46641f164ff28..7fa74fd6890ee8296c8f69670284bff22b039402 100644 --- a/include/staff/templates/user.tmpl.php +++ b/include/staff/templates/user.tmpl.php @@ -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'; ?>;"> diff --git a/scp/css/scp.css b/scp/css/scp.css index 416ee3850dbae1dce7c7c07eab6f32a07656a92d..ffa7a31f6f990e5234191abe1a57bae79900aff8 100644 --- a/scp/css/scp.css +++ b/scp/css/scp.css @@ -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; } diff --git a/scp/js/scp.js b/scp/js/scp.js index 40e77866d0a471df5a4a86888354580af0eafc53..02cc813c4aa0dd53b75954fa2066fa209a391754 100644 --- a/scp/js/scp.js +++ b/scp/js/scp.js @@ -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'