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-75d572ba1ddd
master
Ahmad Syazwan 2012-03-20 08:58:24 +00:00
parent 8a576812f0
commit 70429df0cd
2 changed files with 4 additions and 3 deletions

View File

@ -37,6 +37,7 @@ var isGecko_ = userAgent.indexOf('Gecko/') >= 0;
var isIE_ = userAgent.indexOf('MSIE') >= 0; var isIE_ = userAgent.indexOf('MSIE') >= 0;
var isChrome_ = userAgent.indexOf('Chrome/') >= 0; var isChrome_ = userAgent.indexOf('Chrome/') >= 0;
var isWindows_ = userAgent.indexOf('Windows') >= 0; var isWindows_ = userAgent.indexOf('Windows') >= 0;
var isMac_ = userAgent.indexOf('Macintosh') >= 0;
var supportsSelectors_ = (function() { var supportsSelectors_ = (function() {
return !!svg.querySelector; return !!svg.querySelector;
@ -157,6 +158,7 @@ svgedit.browser.isGecko = function() { return isGecko_; }
svgedit.browser.isIE = function() { return isIE_; } svgedit.browser.isIE = function() { return isIE_; }
svgedit.browser.isChrome = function() { return isChrome_; } svgedit.browser.isChrome = function() { return isChrome_; }
svgedit.browser.isWindows = function() { return isWindows_; } svgedit.browser.isWindows = function() { return isWindows_; }
svgedit.browser.isMac = function() { return isMac_; }
svgedit.browser.supportsSelectors = function() { return supportsSelectors_; } svgedit.browser.supportsSelectors = function() { return supportsSelectors_; }
svgedit.browser.supportsXpath = function() { return supportsXpath_; } svgedit.browser.supportsXpath = function() { return supportsXpath_; }

View File

@ -36,14 +36,13 @@ if(jQuery)( function() {
// Add contextMenu class // Add contextMenu class
menu.addClass('contextMenu'); menu.addClass('contextMenu');
// Simulate a true right click // Simulate a true right click
$(this).bind( "contextmenu mousedown", function(e) { $(this).bind( "mousedown", function(e) {
var evt = e; var evt = e;
$(this).mouseup( function(e) { $(this).mouseup( function(e) {
var srcElement = $(this); var srcElement = $(this);
srcElement.unbind('mouseup'); 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(); e.stopPropagation();
// Hide context menus that may be showing // Hide context menus that may be showing
$(".contextMenu").hide(); $(".contextMenu").hide();