mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-28 18:00:09 +00:00
fixes, tweaks and one hack...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
d4233aaf07
commit
29f2639000
@ -160,9 +160,24 @@ TREE.dir_c.dir_b.tree = TREE
|
||||
var use_disabled = true
|
||||
var show_files = false
|
||||
|
||||
requirejs.config({
|
||||
paths: {
|
||||
'lib/object': '../../node_modules/ig-object/object',
|
||||
'lib/actions': '../../node_modules/ig-actions/actions',
|
||||
'lib/features': '../../node_modules/ig-features/features',
|
||||
//'lib/keyboard': '../../node_modules/ig-keyboard/keyboard',
|
||||
},
|
||||
map: {
|
||||
'*': {
|
||||
'../object': 'lib/object',
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
requirejs([
|
||||
'../keyboard',
|
||||
'../object',
|
||||
'lib/object',
|
||||
'../toggler',
|
||||
'./browse'
|
||||
], function(k, o, t, br){
|
||||
|
||||
@ -158,6 +158,7 @@ requirejs.config({
|
||||
'lib/object': '../../node_modules/ig-object/object',
|
||||
'lib/actions': '../../node_modules/ig-actions/actions',
|
||||
'lib/features': '../../node_modules/ig-features/features',
|
||||
'lib/walk': '../../node_modules/generic-walk/walk',
|
||||
//'lib/keyboard': '../../node_modules/ig-keyboard/keyboard',
|
||||
},
|
||||
map: {
|
||||
|
||||
@ -11,10 +11,7 @@ var toggler = require('../toggler')
|
||||
var keyboard = require('../keyboard')
|
||||
var object = require('../object')
|
||||
var widget = require('./widget')
|
||||
|
||||
// XXX
|
||||
//var walk = require('lib/walk')
|
||||
var walk = require('../../node_modules/generic-walk/walk').walk
|
||||
var walk = require('lib/walk').walk
|
||||
|
||||
|
||||
|
||||
@ -2984,9 +2981,10 @@ var BrowserPrototype = {
|
||||
// Setup basic event handlers...
|
||||
// keyboard...
|
||||
d.addEventListener('keydown',
|
||||
keyboard.makePausableKeyboardHandler(this.keyboard,
|
||||
function(){ console.log('KEY:', ...arguments) },//null,
|
||||
this))
|
||||
this.__keyboard_handler = this.__keyboard_handler
|
||||
|| keyboard.makePausableKeyboardHandler(this.keyboard,
|
||||
function(){ console.log('KEY:', ...arguments) },//null,
|
||||
this))
|
||||
// focus...
|
||||
d.addEventListener('click',
|
||||
function(e){
|
||||
@ -3025,14 +3023,9 @@ var BrowserPrototype = {
|
||||
//
|
||||
// XXX instrument interactions...
|
||||
// XXX register event handlers...
|
||||
// XXX BUG: scrollbar in list can get focus and intercept key events...
|
||||
// - document.querySelector(':focus') returns null
|
||||
// - does not reproduce in the ImageGrid.Viewer
|
||||
// - scrollbar styling does not seem to affect this...
|
||||
// to reproduce:
|
||||
// - load a scrolled dialog...
|
||||
// - click on the scrollbar
|
||||
// - now the browser does not get key events
|
||||
// XXX HANCK: preventing scrollbar from grabbing focus -- there is
|
||||
// definitely a better solution implemented in browse.js + ImageGrid
|
||||
// (the effect seems to be originating out of ImageGrid...)
|
||||
renderList: function(items, context){
|
||||
var that = this
|
||||
var options = context.options || this.options
|
||||
@ -3049,6 +3042,13 @@ var BrowserPrototype = {
|
||||
// list...
|
||||
var list = document.createElement('div')
|
||||
list.classList.add('list', 'v-block')
|
||||
// XXX HACK: prevent scrollbar from grabbing focus...
|
||||
list.addEventListener('mousedown',
|
||||
function(){
|
||||
setTimeout(function(){
|
||||
that.focused
|
||||
&& !list.querySelector(':focus')
|
||||
&& that.focused.dom.focus() }, 0) })
|
||||
items
|
||||
.forEach(function(item){
|
||||
list.appendChild(item instanceof Array ?
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user