some cleanup and refactoring...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2016-03-05 02:45:02 +03:00
parent 655c58be91
commit 239d4a86d7
6 changed files with 61 additions and 1 deletions

View File

@ -365,6 +365,8 @@ stretching in width... */
border: solid 5px red; border: solid 5px red;
background: none; background: none;
z-index: 100; z-index: 100;
/* pass events through... (do we need IE10-?) */
pointer-events: none;
} }
.marker { .marker {
width: 50px; width: 50px;

View File

@ -519,6 +519,9 @@ stretching in width... */
border: solid 5px red; border: solid 5px red;
background: none; background: none;
z-index: 100; z-index: 100;
/* pass events through... (do we need IE10-?) */
pointer-events: none;
} }
.marker { .marker {

View File

@ -107,6 +107,7 @@ core.ImageGridFeatures.Feature('viewer-testing', [
'ui-url-history', 'ui-url-history',
'ui-browse-actions', 'ui-browse-actions',
'ui-context-action-menu',
'ui-widget-test', 'ui-widget-test',
// ui control... // ui control...

View File

@ -347,6 +347,9 @@ module.StatusBar = core.ImageGridFeatures.Feature({
tag: 'ui-status-bar', tag: 'ui-status-bar',
depends: [ depends: [
'ui', 'ui',
// XXX this is here to enable context menu...
'ui-browse-actions',
], ],
actions: StatusBarActions, actions: StatusBarActions,

View File

@ -179,6 +179,54 @@ module.BrowseActions = core.ImageGridFeatures.Feature({
//---------------------------------------------------------------------
var ContextActionMenu =
module.ContextActionMenu = core.ImageGridFeatures.Feature({
title: '',
doc: '',
tag: 'ui-context-action-menu',
depends: [
'ui-browse-actions',
],
handlers: [
['updateImage',
function(){
var that = this
var img = this.ribbons.getImage(gid)
!img.data('context-menu')
&& img
.data('context-menu', true)
.on('contextmenu', function(){
event.preventDefault()
event.stopPropagation()
that.browseActions('/Image/')
})
}],
['load',
function(){
var that = this
var viewer = this.ribbons.viewer
!viewer.data('context-menu')
&& viewer
.data('context-menu', true)
.on('contextmenu', function(){
event.preventDefault()
event.stopPropagation()
that.browseActions()
})
}],
],
})
//--------------------------------------------------------------------- //---------------------------------------------------------------------
// XXX make this not applicable to production... // XXX make this not applicable to production...

View File

@ -23,6 +23,10 @@ var OverlayClassPrototype = {
.on(options.nonPropagatedEvents.join(' '), function(){ .on(options.nonPropagatedEvents.join(' '), function(){
event.stopPropagation() event.stopPropagation()
}) })
.on('contextmenu', function(){
event.preventDefault()
event.stopPropagation()
})
.append($('<div>') .append($('<div>')
.addClass('content') .addClass('content')
.click(function(){ .click(function(){
@ -31,7 +35,6 @@ var OverlayClassPrototype = {
.on('contextmenu', function(){ .on('contextmenu', function(){
event.preventDefault() event.preventDefault()
event.stopPropagation() event.stopPropagation()
return false
}) })
.append(client)) .append(client))