diff --git a/ui (gen4)/features/ui-widgets.js b/ui (gen4)/features/ui-widgets.js index d3ae09b6..b45ceebf 100755 --- a/ui (gen4)/features/ui-widgets.js +++ b/ui (gen4)/features/ui-widgets.js @@ -61,8 +61,9 @@ function(context, cls, data){ // make container... var controls = $('
') .addClass('buttons '+ cls.join('.')) - .on('mouseover', function(){ - var t = $(event.target) + .on('mouseover', function(evt){ + evt = window.event || evt + var t = $(evt.target) var info = t.attr('info') || t.parents('[info]').attr('info') || '' @@ -1931,6 +1932,7 @@ module.ContextActionMenu = core.ImageGridFeatures.Feature({ }), handlers: [ + // XXX FireFox: get actual event... ['imageMenu.pre', function(gid){ event.preventDefault() @@ -1940,6 +1942,7 @@ module.ContextActionMenu = core.ImageGridFeatures.Feature({ .focusImage(gid) .browseActions('/Image/') }], + // XXX FireFox: get actual event... ['imageOuterBlockMenu.pre', function(gid){ // only show image menu in ribbon mode... @@ -1966,9 +1969,10 @@ module.ContextActionMenu = core.ImageGridFeatures.Feature({ !viewer.data('context-menu') && viewer .data('context-menu', true) - .on('contextmenu', function(){ - event.preventDefault() - event.stopPropagation() + .on('contextmenu', function(evt){ + evt = window.event || evt + evt.preventDefault() + evt.stopPropagation() that.browseActions() }) diff --git a/ui (gen4)/features/ui.js b/ui (gen4)/features/ui.js index 96114abf..a4ee4ccd 100755 --- a/ui (gen4)/features/ui.js +++ b/ui (gen4)/features/ui.js @@ -927,15 +927,16 @@ module.Cursor = core.ImageGridFeatures.Feature({ var handler = this.__cursor_show_handler = (this.__cursor_show_handler - || function(){ + || function(evt){ + evt = window.event || evt var threshold = that.config['cursor-show-threshold'] || 0 - x = x || event.clientX - y = y || event.clientY + x = x || evt.clientX + y = y || evt.clientY // show only if cursor moved outside of threshold... if(threshold > 0){ - if(Math.max(Math.abs(x - event.clientX), - Math.abs(y - event.clientY)) > threshold){ + if(Math.max(Math.abs(x - evt.clientX), + Math.abs(y - evt.clientY)) > threshold){ x = y = null that.toggleHiddenCursor('off') } @@ -1418,13 +1419,14 @@ var ControlActions = actions.Actions({ && (y >= dh && y <= H-dh) } var makeImageHandler = function(outerBlockEvt, blockEvt, imageEvt, focus){ - return function(){ - var img = img || $(event.target) + return function(evt){ + evt = window.event || evt + var img = img || $(evt.target) var gid = that.ribbons.elemGID(img) - var x = event.offsetX - var y = event.offsetY + var x = evt.offsetX + var y = evt.offsetY - var clicked_image = isImageClicked(event, img) + var clicked_image = isImageClicked(evt, img) var inner = function(){ focus ? @@ -1863,8 +1865,9 @@ var ControlActions = actions.Actions({ }) // horizontal scroll... - r.on('wheel', function(){ - event.preventDefault() + r.on('wheel', function(evt){ + evt = window.event || evt + evt.preventDefault() var s = that.config['mouse-wheel-scale'] || 1 var vmin = Math.min(document.body.offsetWidth, document.body.offsetHeight) @@ -1889,7 +1892,7 @@ var ControlActions = actions.Actions({ // do the actual move... r.transform({ - x: ((left - (event.deltaX * s)) / vmin * 100) + 'vmin', + x: ((left - (evt.deltaX * s)) / vmin * 100) + 'vmin', }) }) diff --git a/ui (gen4)/lib/keyboard.js b/ui (gen4)/lib/keyboard.js index e25f71cc..07b25c93 100755 --- a/ui (gen4)/lib/keyboard.js +++ b/ui (gen4)/lib/keyboard.js @@ -233,7 +233,7 @@ function parseActionCall(txt, context){ var event2key = module.event2key = function event2key(evt){ - evt = evt || event + evt = evt || window.event // NOTE: we do not care about the jQuery wrapper here... evt = evt.originalEvent || evt @@ -1159,7 +1159,7 @@ function makeKeyboardHandler(keyboard, unhandled, actions){ return function(key, no_match){ no_match = no_match || unhandled var did_handling = false - var evt = event + var evt = window.event var res //if(key instanceof Event || key instanceof $.Event){ diff --git a/ui (gen4)/lib/util.js b/ui (gen4)/lib/util.js index cb25da7f..b7247b5f 100755 --- a/ui (gen4)/lib/util.js +++ b/ui (gen4)/lib/util.js @@ -516,13 +516,14 @@ if(typeof(jQuery) != typeof(undefined)){ .attr('tabindex', '0') .addClass('editable-field') .keydown(events.keydown = function(evt){ + evt = window.event || evt if(!that.prop('contenteditable')){ return } - event.stopPropagation() + evt.stopPropagation() - var n = keyboard.code2key(event.keyCode) + var n = keyboard.code2key(evt.keyCode) // abort... if((options.abort_keys || ['Esc']).indexOf(n) >= 0){ @@ -531,15 +532,15 @@ if(typeof(jQuery) != typeof(undefined)){ // done -- single line... } else if(n == 'Enter' && !options.multiline){ - event.preventDefault() + evt.preventDefault() that.trigger('edit-commit', that.text()) // done -- multi-line... } else if(n == 'Enter' - && (event.ctrlKey || event.metaKey) + && (evt.ctrlKey || evt.metaKey) && options.multiline){ - event.preventDefault() + evt.preventDefault() that.trigger('edit-commit', that.text()) diff --git a/ui (gen4)/lib/widget/overlay.js b/ui (gen4)/lib/widget/overlay.js index 9d986288..e597b506 100755 --- a/ui (gen4)/lib/widget/overlay.js +++ b/ui (gen4)/lib/widget/overlay.js @@ -19,21 +19,25 @@ var OverlayClassPrototype = { var that = this var overlay = $('
') .addClass('overlay-widget modal-widget') - .on(options.nonPropagatedEvents.join(' '), function(){ - event.stopPropagation() + .on(options.nonPropagatedEvents.join(' '), function(evt){ + evt = window.event || evt + evt.stopPropagation() }) - .on('contextmenu', function(){ - event.preventDefault() - event.stopPropagation() + .on('contextmenu', function(evt){ + evt = window.event || evt + evt.preventDefault() + evt.stopPropagation() }) .append($('
') .addClass('content') - .click(function(){ - event.stopPropagation() + .click(function(evt){ + evt = window.event || evt + evt.stopPropagation() }) - .on('contextmenu', function(){ - event.preventDefault() - event.stopPropagation() + .on('contextmenu', function(evt){ + evt = window.event || evt + evt.preventDefault() + evt.stopPropagation() }) .append(client))