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:
Alex A. Naanou 2017-03-09 02:35:28 +03:00
parent 0489315a40
commit 185ea478bb
3 changed files with 38 additions and 1 deletions

View File

@ -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',

View File

@ -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': {
'&#x2630;': ['menu', 'browseActions -- Action menu...'], '&#x2630;': ['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'],
//'&#9965;': ['ui-settings', 'browseActions: "Interface/" -- Interface settings...'], //'&#9965;': ['ui-settings', 'browseActions: "Interface/" -- Interface settings...'],
'&#9974;': ['single-image', 'toggleSingleImage -- View mode'],
}, },
// XXX not sure about these yet... // XXX not sure about these yet...

View File

@ -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)
} }