mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 18:30:09 +00:00
added focus first/last globally image actions + tweaks...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
0b32958599
commit
739ca6eb55
@ -1346,7 +1346,6 @@ module.DataPrototype = {
|
||||
// NOTE: this may result in empty ribbons...
|
||||
// NOTE: this will not crop the .order...
|
||||
//
|
||||
// XXX flatten as an option...
|
||||
// XXX should this link to .root and .parent data???
|
||||
crop: function(list, flatten){
|
||||
var crop = this.clone()
|
||||
@ -1398,6 +1397,7 @@ module.DataPrototype = {
|
||||
//
|
||||
// NOTE: this may result in empty ribbons...
|
||||
//
|
||||
// XXX what are we doing with new ribbons???
|
||||
// XXX sync ribbon order???
|
||||
// XXX should we be able to align a merged crop???
|
||||
// XXX test
|
||||
|
||||
@ -89,13 +89,16 @@ module.GLOBAL_KEYBOARD = {
|
||||
},
|
||||
|
||||
// XXX testing...
|
||||
|
||||
Home: {
|
||||
default: 'firstImage',
|
||||
ctrl: 'firstRibbon',
|
||||
ctrl: 'firstGlobalImage',
|
||||
shift: 'firstRibbon',
|
||||
},
|
||||
End: {
|
||||
default: 'lastImage',
|
||||
ctrl: 'lastRibbon',
|
||||
ctrl: 'lastGlobalImage',
|
||||
shift: 'lastRibbon',
|
||||
},
|
||||
Left: {
|
||||
default: 'prevImage',
|
||||
|
||||
@ -150,6 +150,8 @@ actions.Actions({
|
||||
function(img, list){
|
||||
this.data.focusImage(img, list)
|
||||
}],
|
||||
|
||||
|
||||
focusRibbon: ['Focus Ribbon',
|
||||
function(target){
|
||||
var data = this.data
|
||||
@ -175,11 +177,15 @@ actions.Actions({
|
||||
setBaseRibbon: ['Set base ribbon',
|
||||
function(target){ this.data.setBase(target) }],
|
||||
|
||||
// shorthands for .focusImage(..) and .focusRibbon(..)...
|
||||
firstImage: ['Focus first image in current ribbon',
|
||||
function(){ this.focusImage('first') }],
|
||||
function(all){ this.focusImage(all == null ? 'first' : 0) }],
|
||||
lastImage: ['Focus last image in current ribbon',
|
||||
function(){ this.focusImage('last') }],
|
||||
function(all){ this.focusImage(all == null ? 'last' : -1) }],
|
||||
|
||||
firstGlobalImage: ['Get first globally image',
|
||||
function(){ this.firstImage(true) }],
|
||||
lastGlobalImage: ['Get last globally image',
|
||||
function(){ this.lastImage(true) }],
|
||||
|
||||
prevImage: ['Focus previous image',
|
||||
function(a){
|
||||
@ -217,6 +223,7 @@ actions.Actions({
|
||||
nextImageInOrder: ['Focus next image in order',
|
||||
function(){ this.nextImage(this.data.order) }],
|
||||
|
||||
|
||||
firstRibbon: ['Focus previous ribbon',
|
||||
function(){ this.focusRibbon('first') }],
|
||||
lastRibbon: ['Focus next ribbon',
|
||||
@ -627,6 +634,7 @@ actions.Actions(Client, {
|
||||
// + usable as-is without any extra "features"
|
||||
// - not customizable without rewriting...
|
||||
// - might be too monolithic (god object?)
|
||||
// ...need to think about it a bit more...
|
||||
focusImage: [
|
||||
function(target, list){
|
||||
var ribbons = this.ribbons
|
||||
@ -786,6 +794,7 @@ actions.Actions(Client, {
|
||||
// XXX should these call .images.* or should it be done by data...
|
||||
// ...I think that data is a better candidate as it should be
|
||||
// standalone...
|
||||
// XXX should we have .rotate(..) and .flip(..) generic actions???
|
||||
rotateCW: [
|
||||
function(target){ this.ribbons.rotateCW(target) }],
|
||||
rotateCCW: [
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user