Fix issue 919, patch by duopixel. Also introduced browser.isMac
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2065 eee81c28-f429-11dd-99c0-75d572ba1dddmaster
parent
8a576812f0
commit
70429df0cd
|
@ -37,6 +37,7 @@ var isGecko_ = userAgent.indexOf('Gecko/') >= 0;
|
|||
var isIE_ = userAgent.indexOf('MSIE') >= 0;
|
||||
var isChrome_ = userAgent.indexOf('Chrome/') >= 0;
|
||||
var isWindows_ = userAgent.indexOf('Windows') >= 0;
|
||||
var isMac_ = userAgent.indexOf('Macintosh') >= 0;
|
||||
|
||||
var supportsSelectors_ = (function() {
|
||||
return !!svg.querySelector;
|
||||
|
@ -157,6 +158,7 @@ svgedit.browser.isGecko = function() { return isGecko_; }
|
|||
svgedit.browser.isIE = function() { return isIE_; }
|
||||
svgedit.browser.isChrome = function() { return isChrome_; }
|
||||
svgedit.browser.isWindows = function() { return isWindows_; }
|
||||
svgedit.browser.isMac = function() { return isMac_; }
|
||||
|
||||
svgedit.browser.supportsSelectors = function() { return supportsSelectors_; }
|
||||
svgedit.browser.supportsXpath = function() { return supportsXpath_; }
|
||||
|
|
|
@ -36,14 +36,13 @@ if(jQuery)( function() {
|
|||
|
||||
// Add contextMenu class
|
||||
menu.addClass('contextMenu');
|
||||
|
||||
// Simulate a true right click
|
||||
$(this).bind( "contextmenu mousedown", function(e) {
|
||||
$(this).bind( "mousedown", function(e) {
|
||||
var evt = e;
|
||||
$(this).mouseup( function(e) {
|
||||
var srcElement = $(this);
|
||||
srcElement.unbind('mouseup');
|
||||
if( evt.button === 2 || o.allowLeft || evt.type === "contextmenu" ) {
|
||||
if( evt.button === 2 || o.allowLeft || (evt.ctrlKey && svgedit.browser.isMac()) ) {
|
||||
e.stopPropagation();
|
||||
// Hide context menus that may be showing
|
||||
$(".contextMenu").hide();
|
||||
|
|
Loading…
Reference in New Issue