diff --git a/ui (gen4)/features/ui-single-image.js b/ui (gen4)/features/ui-single-image.js index 7151bb79..19bd5129 100755 --- a/ui (gen4)/features/ui-single-image.js +++ b/ui (gen4)/features/ui-single-image.js @@ -428,6 +428,11 @@ module.SingleImageView = core.ImageGridFeatures.Feature({ } }], + ['imageClick.pre', + function(gid){ + gid == this.current + && this.toggleSingleImage() }], + // Workspace... // ...set ribbon focus mode to order (default) in single image mode... ['saveWorkspace', diff --git a/ui (gen4)/features/ui-widgets.js b/ui (gen4)/features/ui-widgets.js index eb44fba1..a824f992 100755 --- a/ui (gen4)/features/ui-widgets.js +++ b/ui (gen4)/features/ui-widgets.js @@ -1365,6 +1365,16 @@ module.ContextActionMenu = core.ImageGridFeatures.Feature({ var ButtonsActions = actions.Actions({ config: { 'main-buttons-state': 'on', + // Format: + // { + // : [ + // , + // // Button info (optional) + // , + // , + // ], + // ... + // } 'main-buttons': { '☰': ['menu', 'browseActions -- Action menu...'], 'C': ['crop', 'browseActions: "Crop/" -- Crop menu...'], @@ -1372,6 +1382,7 @@ var ButtonsActions = actions.Actions({ //'ImageGrid.Viewer': ['title', ''], //'t': ['touch', 'toggleSideButtons -- Toggle touch ui'], //'⛭': ['ui-settings', 'browseActions: "Interface/" -- Interface settings...'], + '⛶': ['single-image', 'toggleSingleImage -- View mode'], }, // XXX not sure about these yet... diff --git a/ui (gen4)/features/ui.js b/ui (gen4)/features/ui.js index 41a3463e..6dabd656 100755 --- a/ui (gen4)/features/ui.js +++ b/ui (gen4)/features/ui.js @@ -621,6 +621,8 @@ module.ViewerActions = actions.Actions({ `, core.notUserCallable(function(){ // This is the window resize event... + // + // Not for direct use. })], @@ -1883,6 +1885,21 @@ var ControlActions = actions.Actions({ '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', toggler.Toggler(null, function(){ @@ -1917,7 +1934,11 @@ var ControlActions = actions.Actions({ } var handler = setup.handler = setup.handler || function(){ - that.focusImage(that.ribbons.getElemGID($(event.target))) + var gid = that.ribbons.getElemGID($(event.target)) + + that.imageClick.chainCall(that, + function(){ that.focusImage(gid) }, + gid) }