updated: notes save buttons

This commit is contained in:
Thomas Hervey
2018-07-03 10:57:53 -04:00
parent b4c6607384
commit 61ae541cfc
6 changed files with 39 additions and 14 deletions

View File

@@ -68,7 +68,6 @@
margin-top: 10px;
}
/* Note editor UI */
#new-comment-input {
width: 100%;
height: 100px;

View File

@@ -3566,10 +3566,16 @@ img.tile-debug {
vertical-align: middle;
}
.save-section .buttons {
display: flex;
flex-wrap: wrap;
justify-content: space-around;
}
.save-section .buttons .action,
.save-section .buttons .secondary-action {
display: inline-block;
margin: 0 20px 0 0;
width: 45%;
margin: 10px auto;
text-align: center;
vertical-align: middle;
}

View File

@@ -615,7 +615,8 @@ en:
title: Edit note
anonymous: anonymous
commentTitle: Comments
resolve: Resolve
close: Resolve
reopen: Reopen
newComment: New Comment
inputPlaceholder: Enter a comment to share with other users.
comment: Comment

View File

@@ -748,7 +748,8 @@
"title": "Edit note",
"anonymous": "anonymous",
"commentTitle": "Comments",
"resolve": "Resolve",
"close": "Resolve",
"reopen": "Reopen",
"newComment": "New Comment",
"inputPlaceholder": "Enter a comment to share with other users.",
"comment": "Comment",

View File

@@ -220,14 +220,14 @@ export function uiCommit(context) {
buttonEnter
.append('button')
.attr('class', 'secondary-action col5 button cancel-button')
.attr('class', 'secondary-action button cancel-button')
.append('span')
.attr('class', 'label')
.text(t('commit.cancel'));
buttonEnter
.append('button')
.attr('class', 'action col5 button save-button')
.attr('class', 'action button save-button')
.append('span')
.attr('class', 'label')
.text(t('commit.save'));

View File

@@ -156,22 +156,45 @@ export function uiNoteEditor(context) {
buttonEnter
.append('button')
.attr('class', 'secondary-action col5 button cancel-button')
.attr('class', 'secondary-action button cancel-button')
.append('span')
.attr('class', 'label')
.text(t('note.cancel'));
buttonEnter
.append('button')
.attr('class', 'action col5 button save-button')
.attr('class', 'action button save-button')
.append('span')
.attr('class', 'label')
.text(t('note.save'));
var status;
if (_note.status) {
status = _note.status === 'open' ? t('note.close') : t('note.reopen');
}
buttonEnter
.append('button')
.attr('class', _note.status + '-button status-button action button')
.append('span')
.attr('class', 'label')
.text(status);
// update
buttonSection = buttonSection
.merge(buttonEnter);
buttonSection.selectAll('.close-button')
.on('click.close', function() {
console.log('close button clicked');
});
buttonSection.selectAll('.reopen-button')
.on('click.reopen', function() {
console.log('reopen button clicked');
});
buttonSection.selectAll('.cancel-button')
.on('click.cancel', function() {
// var selectedID = commitChanges.entityID(); TODO: cancel note event
@@ -194,11 +217,6 @@ export function uiNoteEditor(context) {
var saveSection = selection.selectAll('.save-section')
.data([0]);
// saveSection = saveSection.enter()
// .append('h4')
// .text(t('note.newComment'))
// .merge(saveSection);
saveSection = saveSection.enter()
.append('div')
.attr('class','save-section cf')