some cleanup...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2013-12-01 05:58:12 +04:00
parent 2087d0768a
commit bda241f7ad
3 changed files with 19 additions and 11 deletions

View File

@ -110,6 +110,13 @@ Roadmap
[_] 30% Gen 3 current todo [_] 30% Gen 3 current todo
[_] 60% High priority [_] 60% High priority
[_] BUG: editor also affects the image background and border...
| to view just set invert to 1
| - background turns white...
| - red border turns blue...
|
| need to either compensate or figure out a way to work around
| this without adding ne tags...
[_] BUG: OSX: unable to load absolute paths... [_] BUG: OSX: unable to load absolute paths...
[_] OSX: add alternatives to function buttons... [_] OSX: add alternatives to function buttons...
[_] Feature: basic editor... [_] Feature: basic editor...

View File

@ -9,7 +9,9 @@
/*********************************************************************/ /*********************************************************************/
var toggleEditor = createCSSClassToggler('.viewer', '.editor-visible', var toggleEditor = createCSSClassToggler(
'.viewer',
'.editor-visible',
function(action){ function(action){
var ed = $('.panel') var ed = $('.panel')
@ -25,7 +27,6 @@ var toggleEditor = createCSSClassToggler('.viewer', '.editor-visible',
$('.panel :focus').blur() $('.panel :focus').blur()
} }
})) }))
// setup the event to update the editor... // setup the event to update the editor...
.on('focusingImage', function(){ .on('focusingImage', function(){
if(toggleEditor('?') == 'on'){ if(toggleEditor('?') == 'on'){

View File

@ -118,6 +118,8 @@ var KEYBOARD_CONFIG = {
// dialogs... // dialogs...
// //
// NOTE: editor effects are not documented, but should be obvious...
// XXX is this the case?
'.viewer.overlay .overlay-block.dialog, .panel :focus': { '.viewer.overlay .overlay-block.dialog, .panel :focus': {
title: 'Dialog', title: 'Dialog',
doc: 'NOTE: to <i>close</i> a dialog, in addition to the keyaboard '+ doc: 'NOTE: to <i>close</i> a dialog, in addition to the keyaboard '+
@ -128,11 +130,12 @@ var KEYBOARD_CONFIG = {
'insert-return': doc('Insert return'), 'insert-return': doc('Insert return'),
Enter: { Enter: {
default: doc('Accept dialog / input', default: doc('Accept dialog',
function(){ function(){
var f = $(':focus') var f = $(':focus')
// trigger the default button action... // trigger the default button/summary action...
// NOTE: for some reason checkboxes in dialogs do not work (not a biggie)...
if(f.length > 0 if(f.length > 0
&& (/button|summary/i.test(f[0].tagName) && (/button|summary/i.test(f[0].tagName)
|| /button|checkbox/i.test(f.attr('type')))){ || /button|checkbox/i.test(f.attr('type')))){
@ -140,7 +143,7 @@ var KEYBOARD_CONFIG = {
// prevent the key from propagating to the viewer... // prevent the key from propagating to the viewer...
return false return false
// accept the input... // accept the input -- e.g. remove focus from it...
} else if(toggleEditor('?') == 'on'){ } else if(toggleEditor('?') == 'on'){
f.blur() f.blur()
// prevent the key from propagating to the viewer... // prevent the key from propagating to the viewer...
@ -157,18 +160,15 @@ var KEYBOARD_CONFIG = {
}, },
Esc: doc('Close dialog', Esc: doc('Close dialog',
function(){ function(){
// hide the overlay...
if(isOverlayVisible('.viewer')){ if(isOverlayVisible('.viewer')){
//getOverlay($('.viewer')).trigger('close') //getOverlay($('.viewer')).trigger('close')
hideOverlay($('.viewer')) hideOverlay($('.viewer'))
return false return false
// blur focused element, if nothing focused close...
} else if(toggleEditor('?') == 'on'){ } else if(toggleEditor('?') == 'on'){
var f = $(':focus') $(':focus').blur()
if(f.length > 0){
f.blur()
} else {
toggleEditor('off')
}
} }
}), }),
}, },