mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-30 19:00:09 +00:00
added comment editing to changes dialog...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
83a16f6e55
commit
1e238e8efe
@ -43,6 +43,7 @@ var ExperimentActions = actions.Actions({
|
|||||||
{dialogTitle: 'Unsaved changes'},
|
{dialogTitle: 'Unsaved changes'},
|
||||||
widgets.makeUIDialog(function(path){
|
widgets.makeUIDialog(function(path){
|
||||||
var that = this
|
var that = this
|
||||||
|
var comment
|
||||||
var handlers_setup = false
|
var handlers_setup = false
|
||||||
return browse.makeLister(null, function(_, make){
|
return browse.makeLister(null, function(_, make){
|
||||||
var keys = Object.keys(that.changes || {})
|
var keys = Object.keys(that.changes || {})
|
||||||
@ -64,9 +65,39 @@ var ExperimentActions = actions.Actions({
|
|||||||
make(key, opts)
|
make(key, opts)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// save comment...
|
||||||
|
if(that.getSaveComment){
|
||||||
|
make('---')
|
||||||
|
comment = comment
|
||||||
|
|| that.getSaveComment()
|
||||||
|
// XXX this behaves in an odd manner...
|
||||||
|
make.Editable(['$Comment: ', comment],
|
||||||
|
{
|
||||||
|
multiline: true,
|
||||||
|
abort_keys: [
|
||||||
|
'Esc',
|
||||||
|
],
|
||||||
|
})
|
||||||
|
.on('edit-commit', function(_, text){
|
||||||
|
that.setSaveComment(
|
||||||
|
$(this)
|
||||||
|
.find('.text')
|
||||||
|
.last()
|
||||||
|
.text())
|
||||||
|
})
|
||||||
|
.on('edit-abort', function(){
|
||||||
|
$(this)
|
||||||
|
.find('.text')
|
||||||
|
.last()
|
||||||
|
.text(comment)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
make('---')
|
make('---')
|
||||||
make('Save', {
|
make('Save', {
|
||||||
open: function(){
|
open: function(){
|
||||||
|
that.setSaveComment
|
||||||
|
&& that.setSaveComment(comment)
|
||||||
that.saveIndexHere
|
that.saveIndexHere
|
||||||
&& that.saveIndexHere()
|
&& that.saveIndexHere()
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user