mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 18:30:09 +00:00
added image click event + click/tap current image to toggle single image (experimental)...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
0489315a40
commit
185ea478bb
@ -428,6 +428,11 @@ module.SingleImageView = core.ImageGridFeatures.Feature({
|
|||||||
}
|
}
|
||||||
}],
|
}],
|
||||||
|
|
||||||
|
['imageClick.pre',
|
||||||
|
function(gid){
|
||||||
|
gid == this.current
|
||||||
|
&& this.toggleSingleImage() }],
|
||||||
|
|
||||||
// Workspace...
|
// Workspace...
|
||||||
// ...set ribbon focus mode to order (default) in single image mode...
|
// ...set ribbon focus mode to order (default) in single image mode...
|
||||||
['saveWorkspace',
|
['saveWorkspace',
|
||||||
|
|||||||
@ -1365,6 +1365,16 @@ module.ContextActionMenu = core.ImageGridFeatures.Feature({
|
|||||||
var ButtonsActions = actions.Actions({
|
var ButtonsActions = actions.Actions({
|
||||||
config: {
|
config: {
|
||||||
'main-buttons-state': 'on',
|
'main-buttons-state': 'on',
|
||||||
|
// Format:
|
||||||
|
// {
|
||||||
|
// <html>: [
|
||||||
|
// <css-class>,
|
||||||
|
// // Button info (optional)
|
||||||
|
// <info>,
|
||||||
|
// <code>,
|
||||||
|
// ],
|
||||||
|
// ...
|
||||||
|
// }
|
||||||
'main-buttons': {
|
'main-buttons': {
|
||||||
'☰': ['menu', 'browseActions -- Action menu...'],
|
'☰': ['menu', 'browseActions -- Action menu...'],
|
||||||
'C<sub/>': ['crop', 'browseActions: "Crop/" -- Crop menu...'],
|
'C<sub/>': ['crop', 'browseActions: "Crop/" -- Crop menu...'],
|
||||||
@ -1372,6 +1382,7 @@ var ButtonsActions = actions.Actions({
|
|||||||
//'<i>ImageGrid.Viewer</i>': ['title', ''],
|
//'<i>ImageGrid.Viewer</i>': ['title', ''],
|
||||||
//'t': ['touch', 'toggleSideButtons -- Toggle touch ui'],
|
//'t': ['touch', 'toggleSideButtons -- Toggle touch ui'],
|
||||||
//'⛭': ['ui-settings', 'browseActions: "Interface/" -- Interface settings...'],
|
//'⛭': ['ui-settings', 'browseActions: "Interface/" -- Interface settings...'],
|
||||||
|
'⛶': ['single-image', 'toggleSingleImage -- View mode'],
|
||||||
},
|
},
|
||||||
|
|
||||||
// XXX not sure about these yet...
|
// XXX not sure about these yet...
|
||||||
|
|||||||
@ -621,6 +621,8 @@ module.ViewerActions = actions.Actions({
|
|||||||
`,
|
`,
|
||||||
core.notUserCallable(function(){
|
core.notUserCallable(function(){
|
||||||
// This is the window resize event...
|
// This is the window resize event...
|
||||||
|
//
|
||||||
|
// Not for direct use.
|
||||||
})],
|
})],
|
||||||
|
|
||||||
|
|
||||||
@ -1883,6 +1885,21 @@ var ControlActions = actions.Actions({
|
|||||||
'center-off-screen-paned-images': false,
|
'center-off-screen-paned-images': false,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
imageClick: ['- Interface/Image click event',
|
||||||
|
core.doc`Image click event
|
||||||
|
|
||||||
|
The .pre(..) stage of the event is called before the clicked
|
||||||
|
image is focused and the .post(..) stage is called after focusing
|
||||||
|
is done.
|
||||||
|
|
||||||
|
NOTE: this does not account for animation.
|
||||||
|
`,
|
||||||
|
core.notUserCallable(function(){
|
||||||
|
// This is image clicked event...
|
||||||
|
//
|
||||||
|
// Not for direct use.
|
||||||
|
})],
|
||||||
|
|
||||||
toggleImageClickHandling: ['Interface/Image click handling',
|
toggleImageClickHandling: ['Interface/Image click handling',
|
||||||
toggler.Toggler(null,
|
toggler.Toggler(null,
|
||||||
function(){
|
function(){
|
||||||
@ -1917,7 +1934,11 @@ var ControlActions = actions.Actions({
|
|||||||
}
|
}
|
||||||
var handler = setup.handler = setup.handler
|
var handler = setup.handler = setup.handler
|
||||||
|| function(){
|
|| function(){
|
||||||
that.focusImage(that.ribbons.getElemGID($(event.target)))
|
var gid = that.ribbons.getElemGID($(event.target))
|
||||||
|
|
||||||
|
that.imageClick.chainCall(that,
|
||||||
|
function(){ that.focusImage(gid) },
|
||||||
|
gid)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user