tweaks and fixes to aliases...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2018-03-29 14:48:30 +03:00
parent 958cae1e1b
commit dd8fc05f13
3 changed files with 10 additions and 7 deletions

View File

@ -184,7 +184,9 @@ var UIAliasActions = actions.Actions({
// XXX should we set white-space: pre on doc here or in css???
// XXX multiline doc edit does not work...
// XXX edit key bindings (???)
// XXX BUG: doc not savable...
// XXX BUG: moving up/down out of a field will not save that field...
// XXX BUG: can't use multi-line fields...
// XXX BUG: renaming alias breaks .browseActions(..)
editAlias: ['- System/Edit alias...',
widgets.makeUIDialog(function(alias){
var that = this
@ -199,8 +201,7 @@ var UIAliasActions = actions.Actions({
edit_text: 'last',
clear_on_edit: false,
reset_on_commit: false,
// XXX bug -- error + clear field???
//abort_on_deselect: false,
abort_on_deselect: false,
}
// doc fields...

View File

@ -543,7 +543,7 @@ if(typeof(jQuery) != typeof(undefined)){
// make the element focusable and selectable...
.attr('tabindex', '0')
.addClass('editable-field')
.keydown(events.keydown = function(jqevt){
.keydown(events.keydown = function(in_evt){
var evt = window.event || in_evt
if(!that.prop('contenteditable')){
return
@ -576,7 +576,7 @@ if(typeof(jQuery) != typeof(undefined)){
} else if(options.propagate_unhandled_keys !== false){
// NOTE: jQuery can't reuse browser events, this
// we need to pass a jq event/proxy here...
$(this).parent().trigger(in_evt)
$(this).parent().trigger(in_evt || evt)
}
})
.blur(events.blur = function(){

View File

@ -356,9 +356,11 @@ function(text, options){
})
.on('deselect', function(){
//editable && editable.trigger(
getEditable()
var editable = getEditable()
// XXX need to pass the text....
editable
.trigger(
options.abort_on_deselect !== false ? 'edit-abort' : 'edit-commit')
options.abort_on_deselect !== false ? 'edit-abort' : 'edit-commit', editable.text())
})
stop_propagation