mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 10:20:08 +00:00
cloud browse working...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
5ca94a26f6
commit
5088530227
@ -1059,13 +1059,13 @@ var WidgetTestActions = actions.Actions({
|
|||||||
})
|
})
|
||||||
})],
|
})],
|
||||||
|
|
||||||
testTagCloud: ['Test/Demo cloud dialog...',
|
testBrowseCloud: ['Test/Demo cloud dialog...',
|
||||||
makeUIDialog(function(){
|
makeUIDialog(function(){
|
||||||
var actions = this
|
var actions = this
|
||||||
|
|
||||||
console.log('>>> args:', [].slice.call(arguments))
|
console.log('>>> args:', [].slice.call(arguments))
|
||||||
|
|
||||||
var res = browse.makeLister(null, function(path, make){
|
return browse.makeLister(null, function(path, make){
|
||||||
var that = this
|
var that = this
|
||||||
|
|
||||||
var words = 'Lorem ipsum dolor sit amet, audiam sensibus '
|
var words = 'Lorem ipsum dolor sit amet, audiam sensibus '
|
||||||
@ -1094,17 +1094,14 @@ var WidgetTestActions = actions.Actions({
|
|||||||
// on sync, but for async dialogs this will align
|
// on sync, but for async dialogs this will align
|
||||||
// the selected field correctly.
|
// the selected field correctly.
|
||||||
make.done()
|
make.done()
|
||||||
|
}, {
|
||||||
|
cloudView: true
|
||||||
})
|
})
|
||||||
// NOTE: this is not a dialog event, it is defined by the
|
// NOTE: this is not a dialog event, it is defined by the
|
||||||
// container to notify us that we are closing...
|
// container to notify us that we are closing...
|
||||||
.on('close', function(){
|
.on('close', function(){
|
||||||
console.log('Dialog closing...')
|
console.log('Dialog closing...')
|
||||||
})
|
})
|
||||||
|
|
||||||
res.dom
|
|
||||||
.addClass('cloud-view')
|
|
||||||
|
|
||||||
return res
|
|
||||||
})],
|
})],
|
||||||
|
|
||||||
// XXX make this a toggler....
|
// XXX make this a toggler....
|
||||||
|
|||||||
@ -66,6 +66,17 @@ function makeBrowserMaker(constructor){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function makeSimpleAction(direction){
|
||||||
|
return function(elem){
|
||||||
|
if(elem != null){
|
||||||
|
this.select(elem)
|
||||||
|
}
|
||||||
|
this.navigate(direction)
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*********************************************************************/
|
/*********************************************************************/
|
||||||
|
|
||||||
@ -124,7 +135,7 @@ var BrowserClassPrototype = {
|
|||||||
// Construct the dom...
|
// Construct the dom...
|
||||||
make: function(obj, options){
|
make: function(obj, options){
|
||||||
var browser = $('<div>')
|
var browser = $('<div>')
|
||||||
.addClass('browse-widget')
|
.addClass('browse-widget '+ ((options.cloudView || false) ? 'cloud-view' : ''))
|
||||||
// make thie widget focusable...
|
// make thie widget focusable...
|
||||||
// NOTE: tabindex 0 means automatic tab indexing and -1 means
|
// NOTE: tabindex 0 means automatic tab indexing and -1 means
|
||||||
// focusable bot not tabable...
|
// focusable bot not tabable...
|
||||||
@ -281,6 +292,9 @@ var BrowserPrototype = {
|
|||||||
// This is mainly used for flat list selectors.
|
// This is mainly used for flat list selectors.
|
||||||
flat: false,
|
flat: false,
|
||||||
|
|
||||||
|
// If set this will switch the browse dialog into cloud mode.
|
||||||
|
cloudView: false,
|
||||||
|
|
||||||
// List of events that will not get propagated outside the browser...
|
// List of events that will not get propagated outside the browser...
|
||||||
//
|
//
|
||||||
// NOTE: these are local events defined on the widget, so it
|
// NOTE: these are local events defined on the widget, so it
|
||||||
@ -440,11 +454,11 @@ var BrowserPrototype = {
|
|||||||
Up: 'up!',
|
Up: 'up!',
|
||||||
Down: 'down!',
|
Down: 'down!',
|
||||||
Left: {
|
Left: {
|
||||||
default: 'pop!',
|
default: 'left!',
|
||||||
ctrl: 'update!: "/"',
|
ctrl: 'update!: "/"',
|
||||||
},
|
},
|
||||||
Backspace: 'Left',
|
Backspace: 'Left',
|
||||||
Right: 'push',
|
Right: 'right',
|
||||||
P: 'push',
|
P: 'push',
|
||||||
|
|
||||||
// XXX
|
// XXX
|
||||||
@ -529,6 +543,18 @@ var BrowserPrototype = {
|
|||||||
this.options.flat = value
|
this.options.flat = value
|
||||||
},
|
},
|
||||||
|
|
||||||
|
get cloud(){
|
||||||
|
return this.dom.hasClass('cloud-view') || this.options.cloudView
|
||||||
|
},
|
||||||
|
set cloud(value){
|
||||||
|
if(value){
|
||||||
|
this.dom.addClass('cloud-view')
|
||||||
|
} else {
|
||||||
|
this.dom.removeClass('cloud-view')
|
||||||
|
}
|
||||||
|
this.options.cloudView = value
|
||||||
|
},
|
||||||
|
|
||||||
// XXX should these set both the options and dom???
|
// XXX should these set both the options and dom???
|
||||||
get traversable(){
|
get traversable(){
|
||||||
return !this.dom.hasClass('not-traversable') && this.options.traversable
|
return !this.dom.hasClass('not-traversable') && this.options.traversable
|
||||||
@ -1723,35 +1749,27 @@ var BrowserPrototype = {
|
|||||||
: this.select(action, filtering)
|
: this.select(action, filtering)
|
||||||
},
|
},
|
||||||
|
|
||||||
// Select next/prev element...
|
// shorthand actions...
|
||||||
next: function(elem){
|
next: makeSimpleAction('next'),
|
||||||
if(elem != null){
|
prev: makeSimpleAction('prev'),
|
||||||
this.select(elem)
|
|
||||||
}
|
|
||||||
this.navigate('next')
|
|
||||||
return this
|
|
||||||
},
|
|
||||||
prev: function(elem){
|
|
||||||
if(elem != null){
|
|
||||||
this.select(elem)
|
|
||||||
}
|
|
||||||
this.navigate('prev')
|
|
||||||
return this
|
|
||||||
},
|
|
||||||
|
|
||||||
up: function(elem){
|
up: makeSimpleAction('up'),
|
||||||
|
down: makeSimpleAction('down'),
|
||||||
|
left: function(elem){
|
||||||
if(elem != null){
|
if(elem != null){
|
||||||
this.select(elem)
|
this.select(elem)
|
||||||
}
|
}
|
||||||
this.navigate('up')
|
return this.cloud ?
|
||||||
return this
|
this.navigate('prev')
|
||||||
|
: this.pop()
|
||||||
},
|
},
|
||||||
down: function(elem){
|
right: function(elem){
|
||||||
if(elem != null){
|
if(elem != null){
|
||||||
this.select(elem)
|
this.select(elem)
|
||||||
}
|
}
|
||||||
this.navigate('down')
|
return this.cloud ?
|
||||||
return this
|
this.navigate('next')
|
||||||
|
: this.push()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user